在 iOS4 中 UIWebView 播放视频损坏?

发布于 2024-09-05 08:09:21 字数 178 浏览 5 评论 0原文

我有一个从 SDK 2.0 版开始运行的应用程序,我在其中创建并添加 UIWebView,然后加载 .mov 的 URL 来播放电影。从 4.0 beta 的早期版本到 4.0 GM,此功能已停止工作。当我现在加载电影时,出现以下错误::插件处理加载”并且电影永远不会显示。

这是一个已知问题吗?我在 4.0 中做错了什么吗?

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.

Is this a known issue? Am I doing something wrong in 4.0?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(4

自此以后,行同陌路 2024-09-12 08:09:42

至少在PhoneGap的ChildBrowser中,didFailLoadWithError方法处理并显示此消息。只需不显示错误,问题就解决了,但在这种特定情况下,在返回应用程序之前需要按两个“完成”按钮。

At least in PhoneGap's ChildBrowser, the didFailLoadWithError method handles and displays this message. Simply don't display the error, problem solved, but in this specific case there are two 'done' buttons to press before you get back to the application.

行雁书 2024-09-12 08:09:40

简单地忽略它即可。这样做没有什么害处。

if (![error.localizedDescription isEqualToString:@"Plug-in handled load"])

Simply just ignore it. No harm in doing so.

if (![error.localizedDescription isEqualToString:@"Plug-in handled load"])
も让我眼熟你 2024-09-12 08:09:39

我在播放视频剪辑时遇到“该影片无法播放”的情况。
刚使用录音机时出现这种情况。而当播放器刚刚使用时,不会发生这种情况。

然后,在录音机完成后,我将音频会话类别设置为 kAudioSessionCategory_AmbientSound。

我这样做之后这个问题就解决了。

I got a situation of "this movie could not be played" when playing a video clip.
This happened when recorder was just used. And this would NOT happen when player was just used.

Then I set audio session category to kAudioSessionCategory_AmbientSound after recorder finished.

This problem was solved after I did that.

长发绾君心 2024-09-12 08:09:35

我明白了这一点。这似乎是 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.

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