iPhone - MPMoviePlayerController 停止缩放视频
我正在使用 MPMoviePlayerController 来播放视频。视频视图的大小为 320 像素,宽度为 200 像素。我已经成功播放视频了。 我显示了播放、暂停等控件。右上角还有一个缩放按钮。单击该按钮后,视频将相应地更改缩放模式。我想防止它结垢。我尝试捕获通知“MPMoviePlayerScalingModeDidChangeNotification”,并将播放器的缩放模式设置为“MPMovieScalingModeAspectFill”(这是我的情况的默认模式)。但它不起作用。 如何防止视频改变比例?
I'm using MPMoviePlayerController to play a video. The video view is of size 320 pixels and 200 pixels in width. I'm successfully playing the video.
I'm showing controls like play, pause, etc. Along with them on the top right, there is a scaling button. On click of that, the video is changing the scaling mode accordingly. I want to prevent it from scaling. I tried to catch the notification "MPMoviePlayerScalingModeDidChangeNotification", and set the player's scaling mode to "MPMovieScalingModeAspectFill" (which is the default one for my case). But its not working.
How can I prevent the video from changing its scale?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的尝试看起来非常正确。尽管如此,我还是会避免以您尝试的方式禁用/覆盖标准功能。想象一下,用户对标准控件突然不起作用(即使它显然没有被禁用)这一事实感到完全困惑。最后但并非最不重要的一点是,苹果可能不喜欢这样。
假设您在 iPhone (480x320) 上以全屏横向模式(宽高比 3:2)播放视频,则完全摆脱缩放按钮的唯一方法是提供与 3:2 宽高比完全匹配的视频。恕我直言,这是实现您所需的唯一且正确的方法。
Your attempt seems pretty much correct. Still I would refrain from disabling/overriding a standard functionality the way you are attempting it. Imagine a user being totally confused by the fact that a standard control suddenly has no effect even though it is clearly not disabled. Last but not least, Apple might not like that.
Assuming you are playing your video in fullscreen landscape mode on an iPhone (480x320) - aspect ratio 3:2, the only way to entirely get rid of that scaling button is to provide a video that exactly matches that 3:2 aspect ratio. That IMHO is the only and proper way for achieving what you need.