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" (wh开发者_如何学JAVAich is the default one for my case). But its not working. How can I prevent the video from changing its scale?
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.
精彩评论