iPhone - MPMoviePlayerController 停止缩放视频

发布于 2024-11-08 13:05:08 字数 266 浏览 0 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

み青杉依旧 2024-11-15 13:05:08

你的尝试看起来非常正确。尽管如此,我还是会避免以您尝试的方式禁用/覆盖标准功能。想象一下,用户对标准控件突然不起作用(即使它显然没有被禁用)这一事实感到完全困惑。最后但并非最不重要的一点是,苹果可能不喜欢这样。

假设您在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文