AVPlayer
has 2 formal conditions that should hold to indicate it's ready to play:
status == AVPlayerStatusReadyToPlay
.currentItem.status == AVPlayerItemStatusReadyToPlay
.
Several developers had noticed that these indicators are not enough, and videos don't actually start playing until loadedTimeRanges
indicates ready-ness (see here and here for implementation details).
These properties should be observed to be put to use, which is costly.
Does a non-zero value in loadedTimeRanges
indicates that the player and playerItem's statuses are ready? This can save 2 observations.