title: Handling AVPlayer stalls
body: <p>I'm trying to catch a moment when <code>AVPlayer</code> is unable to continue playback in case no more media available (too slow network, signal loss, etc). As described in documentation and different examples I'm using <code>KVO</code> to detect this:</p>
  
  <pre><code>item = [[AVPlayerItem alloc] initWithURL:audioURL];
  player = [AVPlayer playerWithPlayerItem:item];
  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onItemNotification:) name:AVPlayerItemPlaybackStalledNotification object:item];
  [item addObserver:self forKeyPath:@"playbackBufferEmpty" options:NSKeyValueObservingOptionNew context:nil];
  [item addObserver:self forKeyPath:@"playbackLikelyToKeepUp" options:NSKeyValueObservingOptionNew context:nil];
  
  ...
  
  - (void) onItemNotification:(NSNotification*)not
  {
      NSLog(@"Item notification: %@", not.name);
  }
  
  ...
  
  - (void) observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object change:(NSDictionary*)change context:(void*)context
  {
      NSLog(@"Observe keyPath %@", keyPath);
  }
  </code></pre>
  
  <p>I'm starting a playback and turn <code>WiFi</code> off after that. Unfortunately neither '<code>playbackBufferEmpty</code>' nor '<code>AVPlayerItemPlaybackStalledNotification</code>' comes. At the moment when playback stops I receive only one <code>AVPlayerItemTimeJumpedNotification</code> and that's all.
  However there were at least 2 times when I got these notifications. But I can't figure out how to get them every time when playback is stalled.
  Am I doing something wrong?</p>