HTML5 视频在 iPad 上不显示

发布于 2024-09-08 05:57:22 字数 569 浏览 1 评论 0原文

我在 http://www.theparkerpalmsprings.com 上编码了一些视频,以便在通过iPhone 或 iPad。在我的测试中,在 iPhone 上查看网站时一切正常(我已经在 3G 和 iPhone 4 上进行过测试),但在 iPad 上加载时,Quicktime 徽标快速闪烁,然后什么也没有发生。这是视频编码的问题还是我做错了什么?任何意见将不胜感激!

一些测试链接(直接到带有视频的页面):

http://theparkerpalmsprings.com/spa/(大iPad 上的视频、iPhone 上的小视频) http://theparkerpalmsprings.com/rooms/estate.php(两个平台的小视频)

I've encoded a few videos on http://www.theparkerpalmsprings.com to play using HTML5 when loaded via an iPhone or iPad. In my testing, everything works as expected when viewing the site on an iPhone (I've tested on a 3G and iPhone 4), but when loading on the iPad the Quicktime logo flashes quickly and then nothing happens. Is this a problem with the encoding of the videos or am I doing something else incorrectly? Any input would be greatly appreciated!

A few test links (directly to pages with video):

http://theparkerpalmsprings.com/spa/ (large video on iPad, small video on iPhone)
http://theparkerpalmsprings.com/rooms/estate.php (small video for both platforms)

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

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

发布评论

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

评论(3

眼中杀气 2024-09-15 05:57:22

答案非常简单,这就是它被忽视的原因:

iPad 要求您在视频标签中包含“控件”属性,否则它无法开始播放视频,这与 iPhone 不同,iPhone 上有一个很大的视频播放器。播放按钮出现在所有 HTML5 视频元素上。视频均已正确编码,但跳过了这个简单的标签。希望这能减轻某人给我带来的头痛。

The answer was incredibly simple, which is why it was overlooked:

The iPad requires you to include the "controls" attribute in the video tag, otherwise there's no way for it to start playback of the video, unlike on the iPhone, where a large play button appears over all HTML5 video elements. The videos were all encoded properly but this simple tag was skipped over. Hopefully this will save someone the headache it caused me.

我很坚强 2024-09-15 05:57:22

请不要嗅探User-Agent

这完全忽略了 HTML5 试图带来的互操作性的要点(并且在我的 Flash 阻止的桌面浏览器中失败了)。 支持自动回退检测


您是否将视频编码为 H.264 基线配置文件? Flash 支持完整的 H.264(High Profile),但 iDevices 只能处理较低质量的变体(iPad 和 iPhone 4 支持 Main,较旧的设备仅支持 Baseline与 AAC 类似。)。


如果您添加替代格式 (WebM),请将 H.264 放在第一位,因为 iOS 3.2 无法正确处理源选择。

Please don't sniff User-Agent!

That completely misses the point of interoperability HTML5 tries to bring (and fails in my Flash-blocked desktop browser). <object> and <video> support automatic fallback and detection.


Did you encode video as H.264 Baseline Profile? Flash supports full H.264 (High Profile), but iDevices can handle only lower-quality variants (iPad & iPhone 4 support Main, older devices only Baseline. Similarily with AAC.).


If you ever add alternative format (WebM), put H.264 <source> first, as iOS 3.2 cannot handle source selection properly.

狼亦尘 2024-09-15 05:57:22

我的 iPad 上也有同样的结果。您打算流式传输视频吗?如果是这样,您需要遵循 Apple 的技术说明 TN2224。

Same result on my iPad. Are you intending to stream the video? If so you'd need to follow Apple's Technical note TN2224.

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