title: AVPlayerViewController exit fullscreen once played
body: <p><strong>Hi, I replaced MPMoviePlayerController with AVPlayerViewController since MPMoviePlayerController is deprecated.
  I'm nearly there, but have one question. My movie start as a view within a view. When playing fullscreen I want it to jump back to NO fullscreen when finished playing. But I don't know how. Here is my code:</strong></p>
  
  <pre><code>- (void)viewDidLoad {
  
  // grab a local URL to our video
  NSURL *videoURL = [[NSBundle mainBundle]URLForResource:@"movie" withExtension:@"m4v"];
  
  // create an AVPlayer
  AVPlayer *player = [AVPlayer playerWithURL:videoURL];
  
  // create a player view controller
  self.controller = [[AVPlayerViewController alloc]init];
  controller.player = player;
  [player play];
  
  
  // show the view controller
  [self addChildViewController:controller];
  [self.view addSubview:controller.view];
  controller.view.frame = CGRectMake(0,25, 750, 422);
  
  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(itemDidFinishPlaying:) name:AVPlayerItemDidPlayToEndTimeNotification object:player];
  }
  </code></pre>
  
  <p><strong>With MPMoviePlayer it used to work with this code:</strong></p>
  
  <pre><code>    - (void) playerPlaybackDidFinish:(NSNotification*)notification{
  // movie finished playing
  [moviePlayerController setFullscreen:NO];
  }
  </code></pre>
  
  <p><strong>With what code do I need to replace it??</strong></p>
  
  <pre><code>-(void)itemDidFinishPlaying:(NSNotification *) notification {
  // Will be called when AVPlayer finishes playing playerItem
   ???????????}
  </code></pre>
  
  <p>Thanks, Meg</p>