muxinc / mux-stats-sdk-avplayer

Mux integration with `AVPlayer` for native iOS, tvOS, and visionOS applications
Apache License 2.0
45 stars 21 forks source link

Improvement: Use AVPlayerItem APIs to track rebuffering #232

Open andrewjl-mux opened 9 months ago

andrewjl-mux commented 9 months ago

Detecting changes in buffer state In order to show an activity indicator when the player stalls, we need to register 3 observers using KVO (Key-Value Observing) on the following dynamic properties of an AVPlayerItem: isPlaybackBufferEmpty isPlaybackBufferFull isPlaybackLikelyToKeepUp

https://www.cyrilchandelier.com/avplayer-buffering