title: AVPlayer In View
body: <p>I am trying to use a video on a view controller but not have it full screen, just enough room for a label on top and a button on bottom, is this possible? If not how can I have it so if the user skips the video or it finishes it goes to a certain viewController?</p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
  
  NSURL *videoURL = [[NSBundle mainBundle]URLForResource:@"TTPlaneHits" withExtension:@"mp4"];
  AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:_player];
  
  
  AVPlayer *player = [AVPlayer playerWithURL:videoURL];
  playerLayer.frame = CGRectMake(0, 21, self.view.frame.size.width, self.view.frame.size.height - 45 - 21);
  [self.view.layer addSublayer:playerLayer];
  AVPlayerViewController *controller = [[AVPlayerViewController alloc]init];
  controller.player = player;
  [player play];
  
  
  [self.view addSubview:controller.view];
  controller.view.frame = self.view.frame;
  </code></pre>