我正在尝试从视图控制器播放电影。我正在使用下面的代码来做到这一点:
VideoPlayerViewController* moviePlayer = [self.storyboard instantiateViewControllerWithIdentifier:@"videoPlayerController"];
moviePlayer.view.frame = rect;
UIWindow *window = [[[UIApplication sharedApplication] windows] lastObject];
[window.rootViewController presentViewController:moviePlayer animated:NO completion:nil];
[moviePlayer playMoviesForItems:items];
通常它工作正常。但有时,电影开始了,但我看不到视频,我只能听到声音。
在一切之上播放视频的最佳方式是什么?