如何知道MPMoviePlayerController正在Iphone OS 3.0中播放 [英] how to know that MPMoviePlayerController is playing in Iphone OS 3.0

查看:66
本文介绍了如何知道MPMoviePlayerController正在Iphone OS 3.0中播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道MPMoviePlayerController是否在特定时刻播放.

I need to know if at an specific moment the MPMoviePlayerController is playing.

在iphone 3.0中,它不会触发MPMoviePlayerContentPreloadDidFinishNotification.

In iphone 3.0 it is not firing the MPMoviePlayerContentPreloadDidFinishNotification.

有人知道任何解决方案吗?

Does anyone knows any solution?

提前谢谢!

推荐答案

相同的问题(但没有答案)此处)

Same question (but no answer) here and several other reports can be found on other sites (e.g. here)

不太理想,但以3.1为目标似乎可以解决问题.

Not ideal, but it seems targeting 3.1 solves the problem.

一种解决方法是,在调用play之前,将MPMoviePlayerController属性scalingMode设置为默认MPMovieScalingModeAspectFit以外的其他值(例如,MPMovieScalingModeNone并确保您的视频尺寸正确),然后挂接事件.电影开始播放后,它似乎被叫(不止一次!).当然,如果用户手动更改缩放模式,也会调用它,因此为此编写代码.脏了,但可以帮您吗?

A workaround maybe to set the MPMoviePlayerController property scalingMode to something other than the default MPMovieScalingModeAspectFit ( e.g. MPMovieScalingModeNone and make sure your video is correct size) before calling play and then hook the MPMoviePlayerScalingModeDidChangeNotification event instead. it seems to get called (more than once!) as soon as the movie starts playing. Of course it will also be called if the user changes the scaling mode manually, so code for this. It's dirty but may help you?

这篇关于如何知道MPMoviePlayerController正在Iphone OS 3.0中播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆