iOS5 上的 HTML5 视频无法加载/显示

发布于 2024-12-09 18:42:23 字数 468 浏览 1 评论 0原文

我有一个 HTML/JS 应用程序在 iPad 应用程序的 Web 视图中运行。该应用程序使用 HTML5 视频标签。视频在 iOS4.3 中工作正常,但今天我在 iOS5 上进行了测试,视频根本不显示。

我通过在视频元素上设置背景颜色和边框来验证这不是与布局相关的问题。

无论应用程序是直接在移动 Safari 中/从主屏幕还是在 Web 视图中运行,相同的行为都是显而易见的。

视频的模板很简单:

<video controls src='{url}'></video> //where {url} is substituted at runtime.

相关视频网址直接在iOS5上的移动Safari中正确播放。

我尝试代理应用程序通信,似乎它确实开始加载视频,但随后停止,没有视频控件显示,只有我设置的背景颜色显示。

任何想法将不胜感激。谢谢。

I have an HTML/JS app running in a webview in an iPad app. The app uses the HTML5 video tag. Videos work fine in iOS4.3 but today I've tested on iOS5 and the videos simply do not show up.

I have verified that it is not a layout related issue by setting background color and borders on the video element.

The same behaviour is evident irrespective of whether the app is run directly in mobile safari /from the home screen or within the webview.

The template for the video is simply:

<video controls src='{url}'></video> //where {url} is substituted at runtime.

The relevant video url plays correctly directly in the mobile Safari on iOS5.

I have tried to proxy the app comms and it seems that it does start loading the video but then stops, no video controls show and only the background color I have set shows thru.

Any ideas would be greatly appreciated. Thanks.

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

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

发布评论

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

评论(3

£冰雨忧蓝° 2024-12-16 18:42:23

您是否尝试过创建一个空的 webview,没有额外的参数和脚本,并确保只调用它一次?当我调用它两次而没有清除以前创建的一个时,我遇到了同样的问题 - 仅播放了音频。

Have you tried create an empty webview, without additional parameters and scripts and make sure that you call it only once? I had the same issue when i call it twice without clearing previously created one - just audio was played.

变身佩奇 2024-12-16 18:42:23

尝试查看 http://blog.millermedeiros.com/2011/03/html5-video-issues-on-the-ipad-and-how-to-solve-them/ 看看是否该修复对你有用...

嘿嘿 - 应该阅读细则 - 没有注意到你已经回答了自己 - 记得在回答时勾选线程

Try to look at http://blog.millermedeiros.com/2011/03/html5-video-issues-on-the-ipad-and-how-to-solve-them/ and see if the fix works for you...

he he - should have read the fine print - did not notice you had answered yourself - remember to tick the thread off as answered

我为君王 2024-12-16 18:42:23

我已经在代码中修复了这个问题,方法是在创建视频元素后将宽度和高度更改一个像素。必须调用重画或其他方法来达到此效果

I've fixed this in code by changing the width and height by a pixel once the video element is created. Must invoke a repaint or something to that effect

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