简体   繁体   English

在avplayerlayer上设置视频重力而没有动画效果

[英]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.

相关问题 设置AVPlayerLayer VideoGravity适用于模拟器,而不适用于iPad - Setting AVPlayerLayer VideoGravity works on Simulator, not on iPad 动画AVPlayerLayer videoGravity属性 - Animate AVPlayerLayer videoGravity property 将 videoGravity 设置为 AVLayerVideoGravityResizeAspectFill 对 iOS 5.0 没有影响 - Setting videoGravity to AVLayerVideoGravityResizeAspectFill has no effect on iOS 5.0 当videoGravity设置为AVLayerVideoGravityResizeAspectFill时,AVPlayerLayer视频“溢出” - AVPlayerLayer video “overspilled” when videoGravity set to AVLayerVideoGravityResizeAspectFill Swift AVPlayerLayer videoGravity.resizeAspect 只考虑高度而不是宽度 - Swift AVPlayerLayer videoGravity .resizeAspect only respects height not width 重新初始化AVQueuePlayer,而无需创建新的AVPlayerLayer - Reinitializing AVQueuePlayer without haing to create new AVPlayerLayer iOS navigationBar设置透明无效果 - iOS navigationBar Setting transparent without effect AVSampleBufferDisplayLayer:改变视频重力动画 - AVSampleBufferDisplayLayer: change videoGravity animated 如何在不将视图设置为nil的情况下进行水平翻转动画? - How to do a horizontal flip animation without setting views to nil? 是否有具有脉动效果的动画? - Is there an animation that does a pulsating effect?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM