title: Register AVPlayer for events - how to know AVPlayer is done playing movie
body: <p>I know that AVPlayerItem (a subclass of AVPlayer) is able to subscribe to the <code>AVPlayerItemDidPlayToEndTimeNotification</code> </p>
  
  <p>AVPlayer does not have such capability, and I need to use AVPlayer unless there is no way around this and know when the playing of the (video in my case) is complete. </p>
  
  <p>How do I do this in an AVPlayer? I read some of the documentation for these classes and I do not see an immediate answer. </p>
  
  <pre><code>-(void)setupVideoView{
  
  
      _videoPlayer = [AVPlayer playerWithURL:urlObjectHere];
  
      AVPlayerLayer *layer = [AVPlayerLayer layer];
  
      [layer setPlayer:_videoPlayer];
      [layer setFrame:_videoView.bounds];
  
      [_videoView.layer addSublayer:layer];
  
      [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(itemDidFinishPlaying:) name:AVPlayerItemDidPlayToEndTimeNotification object:_videoPlayer];
  
  
  
  
  }
  
  -(void)itemDidFinishPlaying:(NSNotification *) notification {
      // does not get called
  
      DLog(@"");
  
  
  
  }
  </code></pre>