---
title: duration
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avplayeritem/duration
---

# duration

The duration of the item.

## Declaration

```swift
nonisolated var duration: CMTime { get }
```

## Discussion

Discussion This property indicates the duration of the item, not considering either its forwardPlaybackEndTime or reversePlaybackEndTime. The system reports the value of this property as indefinite until it loads the duration of the underlying asset. There are two ways to make sure you don’t access the value of duration until the system makes it available: Wait until the status of the player item is AVPlayerItem.Status.readyToPlay. Register for key-value observation of the property and request the initial value. If the system reports the initial value as indefinite, wait for the player item to notify you when duration becomes available. note: The value of duration may remain indefinite for live streams.

## See Also

### Accessing timing information

- [currentTime()](avfoundation/avplayeritem/currenttime().md)
- [currentDate()](avfoundation/avplayeritem/currentdate().md)
- [timebase](avfoundation/avplayeritem/timebase.md)
