muxinc / mux-stats-sdk-avplayer

Mux integration with `AVPlayer` for iOS Native Applications
Apache License 2.0
45 stars 21 forks source link

Improvement: Use AVPlayerItem APIs to track rebuffering #232

Open andrewjl-mux opened 8 months ago

andrewjl-mux commented 8 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