关闭 MPMoviePlayerViewController 的全屏模式时出现问题
在我的应用程序中,我使用 MPMoviePlayerViewController 来播放在线视频。视频在横向模式下应以全屏模式播放,而在旋转到纵向模式时应关闭全屏模式。 我能够以全屏模式播放视频。但当设备方向更改为纵向模式时无法关闭它。
我正在使用 [mpController.moviePlayer setFullscreen:FALSE 动画:YES];
请有人帮忙。
提前致谢。
In my application i am using MPMoviePlayerViewController to play online video. The video should play in fullscreen mode when in landscape and the fullscreen mode should be dismissed when it rotates to portrait mode.
I am able to play the video in fullscreen mode. But not able to dismiss it when the device orientation changes to portrait mode.
I am using [mpController.moviePlayer setFullscreen:FALSE animated:YES];
Someone please help.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您正在尝试检测呈现 MPMoviePlayerViewController 的视图控制器中的方向变化?呈现电影播放器视图控制器后不会触发此代码,因为它(而不是其父级)将接收旋转事件。
但是,您可以订阅设备旋转通知,并在检测到纵向旋转时关闭电影播放器视图控制器:
在同一视图控制器的其他位置:
I assume you're trying to detect the orientation change in the view controller that present
MPMoviePlayerViewController
? This code won't be fired after the movie player view controller is presented because it—not its parent—will receive the rotation events.You can, however, subscribe to the device rotation notifications and dismiss the movie player view controller whenever you detect a rotation to portrait:
Elsewhere in the same view controller:
为
UIDeviceOrientationDidChangeNotification
或UIApplicationWillChangeStatusBarOrientationNotification
设置观察者,检查新的所需方向并为 MPMoviePlayerViewController 设置新模式。Set observer for
UIDeviceOrientationDidChangeNotification
orUIApplicationWillChangeStatusBarOrientationNotification
, check new required orientation and set new mode for MPMoviePlayerViewController.