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