How to make a AVPlayerViewController go to fullscreen programmatically?

前端 未结 9 1155
既然无缘
既然无缘 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 20:49

    AVPlayerViewController is a subclass of UIViewController, so it is presentable like any other view controller subclass. Are you able to use presentViewController:animated:completion?

    self.avPlayerController.modalPresentationStyle = UIModalPresentationOverFullScreen;
    [self presentViewController:self.avPlayerController animated:YES completion:nil];
    

    This then shows the "Done" button in the top left-hand corner.

提交回复
热议问题