title: Detecting video stalls in AVPlayer
body: <p>I am playing a HLS stream using <code>AVPlayer</code> API in my app. I would like to be able to detect situations where the video playback is stalled as result of insufficient network bandwidth or low connection quality.</p>
  
  <p>Is there any reliable way of detecting if the video playback is actually playing normally on the screen?</p>
  
  <p>During my testing I've seen situations where the following checks are all reporting OK statuses despite video playback being actually frozen on the screen:</p>
  
  <pre><code>AVPlayer.status = .readyToPlay
  AVPlayer.timeControlStatus = .playing
  AVPlayerItem.status = .readyToPlay
  AVPlayerItem.isPlaybackBufferEmpty = false
  AVPlayerItem.isPlaybackLikelyToKeepUp  = true
  </code></pre>
  
  <p>+ and also <code>addBoundaryTimeObserver</code> callbacks were fired.</p>
  
  <p>Some of these eventually become negative, but only after a delay.</p>
  
  <p>Is there is any 100% reliable way of detecting if a video is actually playing fine on the device?</p>