MPMoviePlayerController - 全屏播放
从这段代码开始:
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:movieLink];
我需要做的下一件事是设置播放器的框架并将其视图添加为子视图。但我希望它立即进入全屏,并且我希望它位于其他所有内容之上。最好的方法是什么?
如果我做这样的事情:
[self.view addSubview:player.view];
播放器做了一个奇怪的调整大小的事情,然后跳到全屏。我知道这是最后一步:
[player setFullscreen:YES animated:NO];
但是我在哪里可以添加玩家的视图,这样我就不会看到任何奇怪的剪辑或调整大小?我是否以某种方式使用[UIScreen mainScreen]?或者访问应用程序的主窗口?
Starting with this code:
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:movieLink];
The next thing I need to do is set the player's frame and add its view as a subview. But I want it to go immediately to fullscreen, and I want it to be on top of everything else. What is the best way to do that?
If I do something like this:
[self.view addSubview:player.view];
The player does a weird resizing thing, then jumps to fullscreen. I know this is the last step:
[player setFullscreen:YES animated:NO];
But where can I add the player's view so that I don't see any weird clipping or resizing? Do I use [UIScreen mainScreen] somehow? Or access the main window of the app?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论