如何阻止 MPMoviePlayerController 显示“无法播放此电影。”?
我使用 MPMoviePlayerController 在 iPhone 上播放一些视频和音频流。
有时某些 Steam 不可用,因此在 iPhone OS 3.1 上,即使我收到了所有通知,我也会收到 4 条“此电影无法播放”警报。
谁能告诉我如何防止这种情况发生?
I use MPMoviePlayerController
to play some Video and Audio streams on iPhone.
Sometimes some steams aren't available, so on iPhone OS 3.1 I get 4 "This movie could not be played" alerts, even if I catch all the notifications.
Can anyone tell me how to prevent this from happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了防止
MPMoviePlayerController
显示UIAlertView
警报,您可以使用以下方法:将以下方法添加到您的应用程序委托中,并确保调用
patchMPVVC
仅在启动时一次:请记住,此代码可能会被苹果拒绝,因为它引用了私有
MPVideoViewController
类和_videoView_playbackErrorNotification
方法。in order to prevent the
MPMoviePlayerController
from displayingUIAlertView
alerts, you can use the following approach:add the following methods to your application delegate, and make sure to call
patchMPVVC
only once on startup:just keep in mind that this code might be rejected by apple due to the fact that it references the private
MPVideoViewController
class and_videoView_playbackErrorNotification
method.我很遗憾地告诉您,(据我所知)这是不可能做到的。
我也处理过同样的问题,尽管我花了很多时间调查这个问题,但我找不到解决方案。
I'm sorry to tell you that this is (to the best of my knowledge) not possible to do.
I've dealt with the same issue too and even though I spent quite a lot of time investigating the issue, I couldn't find a solution.