jeudi 13 août 2015

AVPlayerLayer inside UIScrollView Not Zooming To Center

  • I have a UIScrollView *myScrollView which has a UIView *videoView that contains a AVPlayerLayer *playerLayer(Actually a PBJVideoView if anyone is familiar).
  • The AVPlayerLayer is set to AVLayerVideoGravityResizeAspect.
  • myScrollView's delegate's - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView returns videoView.

So if I am looking at a landscape video on a portrait oriented iPhone, it fits the video so that the width matches the iPhone and there is black at the top and bottom.

As the zoomScale goes above 1.0 the video seems biased towards the right side. Like the anchorPoint is maybe (0.75,0.5) - even though it is (0.5,0.5). In other words it zooms into a point to the right of center.

Is there something with the AVPlayerLayer that is causing this issue? I don't have the same problem with a UIImageView?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire