简体   繁体   中英

Setting videogravity on avplayerlayer without animation effect

I am trying to set the videogravity on an avplayerlayer. 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. 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;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM