mpmovieplayercontroller问题
我的电影播放器中的一个小问题..![电影播放器显示如下]
1:https://i.sstatic.net/WujxB.png 但我想显示如下屏幕截图
我的代码:
moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
moviePlayerController.view.frame = CGRectMake(0,0,320,460);
moviePlayerController.fullscreen = YES;
[self.view addSubview:moviePlayerController.view];
[moviePlayerController play];
one small issue in my movieplayer..![movieplayer shows like this]
1: https://i.sstatic.net/WujxB.png but i want to show as below screenshot
mycode:
moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
moviePlayerController.view.frame = CGRectMake(0,0,320,460);
moviePlayerController.fullscreen = YES;
[self.view addSubview:moviePlayerController.view];
[moviePlayerController play];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这些是全屏播放的默认控件,因为您设置了moviePlayerController.fullscreen = YES。
您想要的控件用于嵌入式播放,而不是全屏播放。
您想要的是
moviePlayerController.controlStyle = MPMovieControlStyleEmbedded;
但只有当您的电影嵌入到您的某个视图中时才能使用它。然后您将拥有所需的控件,包括全屏和嵌入之间的切换。Those are the default controls for fullscreen playback, since you set
moviePlayerController.fullscreen = YES
.The controls you want are for embedded playback, not fullscreen.
What you want is
moviePlayerController.controlStyle = MPMovieControlStyleEmbedded;
but you can only use it if your movie is embbeded in one of your views. Then you would have the controls that you want, including a toggle between fullscreen and embedded.您必须使用
MPMoviePlayerViewController
而不是使用MPMoviePlayerController
。You have to use
MPMoviePlayerViewController
instead of usingMPMoviePlayerController
.