title: AVPlayer Skips the Beginning of a Video
body: <p>I'm having an issue with AVPlayer skipping the first 0.5 seconds of a video I'm playing when I attempt to play it immediately after pre-rolling. </p>
  
  <p>First, I create the player:</p>
  
  <pre><code>self.videoPlayer = [[AVPlayer alloc] init];
  </code></pre>
  
  <p>Then, I add the player item to the player and add an observer to check and see when the item is ready:</p>
  
  <pre><code>[self.videoPlayer addObserver:self forKeyPath:@"currentItem" options:0 context:kBLCurrentPlayerItemStatusContext];
  [self.videoPlayer replaceCurrentItemWithPlayerItem:self.currentVideoPlayerItem];
  </code></pre>
  
  <p>When the player item is observed, I will check to see if the player is ready to play.  If it's not ready to play, I will add an observer to make sure it's ready to play:</p>
  
  <pre><code>-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{
  ...
  } else if (context == kBLCurrentPlayerItemStatusContext) {
         [self.videoPlayer removeObserver:self forKeyPath:@"currentItem" context:&amp;kBLCurrentPlayerItemStatusContext];
         if ([self.videoPlayer status]==AVPlayerStatusReadyToPlay) {
               [self prerollVideoPlayer];
         } else {
               [self.videoPlayer addObserver:self forKeyPath:@"status" options:0 context:&amp;kBLVideoPlayerStatusContext];
         }
  }
  ...
  </code></pre>
  
  <p>When the player status is observed as ready to play, I then preroll the player:</p>
  
  <pre><code>-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{
  ...
    if (context == kBLVideoPlayerStatusContext) {
        if ([self.videoPlayer status] == AVPlayerStatusReadyToPlay) {
              [self.videoPlayer removeObserver:self forKeyPath:@"status" context:&amp;kBLVideoPlayerStatusContext];
              [self prerollVideoPlayer];
        }
  }
  ...
  </code></pre>
  
  <p>After the pre-roll is complete, I play the player:</p>
  
  <pre><code>-(void)prerollVideoPlayer{
      [self.videoPlayer prerollAtRate:1.0 completionHandler:^(BOOL finished){
          if (finished) {
                  [self.videoPlayer play];
          }
      }];
  }
  </code></pre>
  
  <p>When the player plays in this way, it skips the first ~0.5 seconds of the video.  If I don't have the player play immediately when it's finished pre-rolling, and I call the play method later it plays fine.  I've checked to make sure all the observers are correctly observed and they occur in the order I've noted above.  Is there another observer I need to add or a notification I should check for to avoid this skipping behavior?  </p>