[英]Setting videogravity on avplayerlayer without animation effect
I am trying to set the videogravity on an avplayerlayer. 我正在尝试在avplayerlayer上设置videogravity。 When I set the player layer like so:
当我像这样设置播放器层时:
[(AVPlayerLayer *)[self layer] setVideoGravity:AVLayerVideoGravityResizeAspectFill]
The video looks like it drops on the view (some sort of animation effect). 视频看起来像是落在视图上(某种动画效果)。 Is there any way to avoid this effect?
有什么办法可以避免这种影响? FYI, I've tried assigning the avplayer to the layer before and after setting the gravity and there is no different.
仅供参考,我尝试过在设置重力之前和之后将avplayer分配给图层,并且没有区别。 When I don't set gravity, the video appears as I want it to (without any drop on screen animation).
当我不设置重力时,视频将按我的意愿显示(屏幕动画没有下降)。
AVPlayerLayer *vlayer;
vlayer.speed = isAnimated ? 1 : 999;
vlayer.videoGravity = AVLayerVideoGravityResizeAspect;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.