How to make a AVPlayerViewController go to fullscreen programmatically?

前端 未结 9 1092
既然无缘
既然无缘 2020-12-29 20:12

I\'m trying to make a AVPlayerViewController go to full screen mode programmatically, coming from \"embedded\" mode, however this does not appear to be possible with the pub

9条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-29 21:01

    You can just set the videoGravity property of AVPlayerViewController.

    if(fullscreen)
    {
        [self.avPlayerController 
         setVideoGravity:AVLayerVideoGravityResizeAspectFill];
    }
    else
    {
        [self.avPlayerController 
        setVideoGravity:AVLayerVideoGravityResizeAspect];
    }
    

提交回复
热议问题