title: video iOS 11/ xcode 9
body: <p>I use this code to start a video (not full screen). People can press the <strong>'full screen'</strong> button to switch to full screen. However in iOS 11 beta the video turns black in full screen and I can't reverse it or get it playing again.</p>
  
  <p>Is there an easy fix to update my code for iOS 11? Or does anyone know where to find a sample for this. I searched, but didn't find anything yet. 
  Thanks a lot, Meg</p>
  
  <pre><code>-(void)viewDidLoad {
  
         [super viewDidLoad];
  
      // grab a local URL to our video
      NSURL *videoURL = [[NSBundle mainBundle]URLForResource:@"pres 2" 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);
  
  }
  
  
  -(void)playerItemDidReachEnd:(NSNotification *) notification{
      //remove the player
  
  }
  
  
  -(void) viewWillDisappear:(BOOL)animated{
  
      [super viewWillDisappear:animated];
  
      [controller.player replaceCurrentItemWithPlayerItem:nil];
  }
  
  -(void) viewDidDisappear:(BOOL)animated{
  
      [super viewDidDisappear:animated];
      [controller.player replaceCurrentItemWithPlayerItem:nil];
  
  }
  </code></pre>