I'm trying to create a more generic media controller for several types of streaming media and want to adapt the UI to the type of stream;
Is there any way to determine from the AVPlayer (or perhaps the AVPlayerItem or AVAsset) what the type of stream is?
The duration of live video is indefinite:
AVPlayer * player = ...;
const BOOL isLive = CMTIME_IS_INDEFINITE([player currentItem].duration);
You have to check the duration only when the AVPlayerItem
item status is AVPlayerItemStatusReadyToPlay
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With