title: How can i get AVPlayer y position, height, width in AVPlayerLayer in objective c
body: <p>I want to get position of video in <code>AVPlayer</code> x,y and height,width of display video in <code>AVPlayerLayer</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/KpiGE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KpiGE.jpg" alt="enter image description here"></a>   </p>
  
  <p>My code is : </p>
  
  <pre><code>NSString *path = [[NSBundle mainBundle] pathForResource:@"Video" ofType:@"mp4"];
  NSURL *url=[[NSURL alloc]initFileURLWithPath:path];
  AVPlayer *av = [[AVPlayer alloc] initWithURL:url];
  AVPlayerLayer *layer = [AVPlayerLayer playerLayerWithPlayer:av];
  [layer setFrame:self.view.frame];
  [self.view.layer addSublayer:layer];
  [av play];
  </code></pre>