我有一个从 SDK 2.0 版开始工作的应用程序,我在其中创建和添加 UIWebView,然后加载 .mov 的 URL 以播放电影.从 4.0 beta 的早期版本到 4.0 GM,这已经停止工作.当我现在加载电影时,出现以下错误::插件处理加载"并且电影永远不会显示.
I have an app that's worked since version 2.0 of the SDK where I create and add a UIWebView and then load the URL of an .mov to play a movie. Ever since the early version of the 4.0 beta up until the 4.0 GM this has stopped working. When I load a movie now I get the following error: :Plug-in handled load" and the movie never displays.
这是一个已知问题吗?我在 4.0 中做错了吗?
Is this a known issue? Am I doing something wrong in 4.0?
我想通了.这似乎是 iOS4 不向后兼容使用init"而不是initWithFrame"创建的 UIWebView 的问题.在 2.0 - 3.1.3 中,您只能在 UIWebview 中将视频显示为全屏.我认为这就是为什么调用init"并不重要——电影播放器会启动并全屏显示.但是,在 3.2 及更高版本中,您现在可以在 UIWebView 中内联视频,因此您必须调用 initWithFrame 并为其提供类似 [[UIScreen mainScreen] bounds] 的内容,以便有一个可见的视图.不太确定这是否是牛市,但似乎是这样.
I figured this out. It appears to be an issue with iOS4 not being backward compatible with a UIWebView created with 'init' rather than 'initWithFrame'. In 2.0 - 3.1.3, you could only show video in a UIWebview as full screen. I think this is why it didn't matter if you called 'init' -- the movie player would kick in and go fullscreen. However, in 3.2 and higher you can now inline video in a UIWebView so you have to call initWithFrame and give it something like [[UIScreen mainScreen] bounds] so there's a visible view. Not quite sure if this is bull or not but seems to be the case.
这篇关于在 iOS4 中损坏的 UIWebView 中播放视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!