MPMoviePlayerController,不允许全屏但允许通过剪辑导航?
我的 iPad 应用程序中有一个视频,但我不希望它能够全屏显示。不过,我确实希望用户能够导航到他们想要观看的视频部分。
据我所知,您为用户提供的控件只有三个选项: 无、嵌入式或全屏。
None 不让用户无法控制。 嵌入式和全屏基本上为用户提供相同数量的控制,但只是在不同的状态下启动。
基本上我想要的是嵌入并取消切换到全屏选项。
有人知道是否可能吗?谢谢
I have a video in my iPad app, but I dont want it to be able to go to fullscreen. However I do potentially want the user to be able to navigate to the part of the video that they want to see.
As far as I can tell there are only three options for the controls that you give the user:
None, Embedded, or Fullscreen.
None gives the user no control.
Embedded and Fullscreen basically give the use the same amount of control but just start in different states.
Basically what I want is Embedded with the switch to Fullscreen option taken out.
Anybody know if its possible? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将控件样式设置为“无”,然后添加您自己的自定义视图以使用 UISlider 进行导航(我过去曾这样做过)。
MPMoviePlayerController 遵循 MPMediaPlayback 协议,因此您可以将影片的总播放时间乘以 UISlider 值(当该值发生变化时),然后调整影片的播放头位置。
您还需要一个 NSTimer 或 KVO 来监控播放时间,以便它可以实时更新滑块 UI 元素。
You can set the controls style to "None", and then add your own custom view to navigate using a UISlider (I've done this in the past).
MPMoviePlayerController adheres to the MPMediaPlayback protocol, so you take the total playback time of the movie, multiply it by the UISlider value (when it changes), and then adjust the movie's playback head position.
You'll also need an NSTimer or KVO to monitor the playback time so it can update the slider UI element in realtime.