title: AVPlayer buffering issue
body: <p>I have an AVPlayer in my app which is playing video files from a stream, My problem is it freezes sometimes and i have to press the play button again to resume. For the buffering issue i have used the following code, but still no success, can anyone suggest me a solution.</p>
  
  <p>in  ViewDidLoad method</p>
  
  <pre><code>[mPlayer addObserver:self forKeyPath:@"playbackBufferEmpty" options:NSKeyValueObservingOptionNew context:nil];
  [mPlayer addObserver:self forKeyPath:@"playbackLikelyToKeepUp" options:NSKeyValueObservingOptionNew context:nil];
  </code></pre>
  
  <p>in observeValueForKeyPath method</p>
  
  <pre><code>if (!mPlayer)
  {
      return;
  }
  
  else if (object == mPlayerItem &amp;&amp; [path isEqualToString:@"playbackBufferEmpty"])
  {
      if (mPlayerItem.playbackBufferEmpty) {
          //Your code here
      }
  }
  
  else if (object == mPlayerItem &amp;&amp; [path isEqualToString:@"playbackLikelyToKeepUp"])
  {
      if (mPlayerItem.playbackLikelyToKeepUp)
      {
          //Your code here
      }
  }
  </code></pre>
  
  <p>but the above if statements will never get called. Also I am using the AVPlayerDemo class demonstrated in the here:  <a href="https://developer.apple.com/library/ios/samplecode/AVPlayerDemo/Listings/Classes_AVPlayerDemoPlaybackViewController_m.html" rel="nofollow">https://developer.apple.com/library/ios/samplecode/AVPlayerDemo/Listings/Classes_AVPlayerDemoPlaybackViewController_m.html</a></p>