---
title: "CMTimeRangeGetUnion(_:otherRange:)"
framework: coremedia
role: symbol
role_heading: Function
path: "coremedia/cmtimerangegetunion(_:otherrange:)"
---

# CMTimeRangeGetUnion(_:otherRange:)

Returns a new time range with the time elements of the input.

## Declaration

```swift
func CMTimeRangeGetUnion(_ range: CMTimeRange, otherRange: CMTimeRange) -> CMTimeRange
```

## Parameters

- `range`: The first time range.
- `otherRange`: The second time range.

## Return Value

Return Value A time range with the unique time elements of the input.

## Discussion

Discussion The return value contains the smallest range that includes all times that are in either range.

## See Also

### Inspecting Time Ranges

- [CMTIMERANGE_IS_EMPTY(_:)](coremedia/cmtimerange_is_empty(_:).md)
- [CMTIMERANGE_IS_INDEFINITE(_:)](coremedia/cmtimerange_is_indefinite(_:).md)
- [CMTIMERANGE_IS_INVALID(_:)](coremedia/cmtimerange_is_invalid(_:).md)
- [CMTIMERANGE_IS_VALID(_:)](coremedia/cmtimerange_is_valid(_:).md)
- [CMTimeRangeGetEnd(_:)](coremedia/cmtimerangegetend(_:).md)
- [CMTimeRangeGetIntersection(_:otherRange:)](coremedia/cmtimerangegetintersection(_:otherrange:).md)
