在 iPhone 3GS 与 iPhone 4 上为 Mobile Safari 嵌入 HTML5 视频
我在服务器上的 mp4 文件中有 H.264/AAC 编码的视频,mime 类型的视频/mp4 添加到 Web 服务器 (IIS 7),并且我有一个带有视频标签的页面:
<video id="html5-video" width="360" height="202" poster="/images/poster.png" controls>
<source src="/video/Web-360x202-14MB.mp4" type="video/mp4">
</video>
在iPhone 4,但在 iPhone 3GS(相同的 iOS 版本,4.3.2)上仅显示海报图像,点击它不会启动视频。
当我尝试直接打开视频文件时,我从 Mobile Safari 开发者控制台收到“提示”:
其他提示
QuickTime
电影无法播放
要使 HTML5 视频在 iPhone 3GS 上运行需要什么?是编码问题吗?
I have an H.264/AAC encoded video in an mp4 file on the server, the mime-type video/mp4 is added to the web server (IIS 7), and I have a page with a video tag:
<video id="html5-video" width="360" height="202" poster="/images/poster.png" controls>
<source src="/video/Web-360x202-14MB.mp4" type="video/mp4">
</video>
Works great on an iPhone 4, but on an iPhone 3GS (same iOS version, 4.3.2) is only shows the poster image and tapping it doesn't start the video.
When I try to open the video file directly, I get a 'tip' from the Mobile Safari developer console:
Other Tip
QuickTime
Movie could not be played
What is needed to get HTML5 video working on an iPhone 3GS? Is it an encoding issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到过同样的问题,是的,这似乎是一个编码问题。我遵循此处提供的通用智能手机配置文件:
http://blog.zencoder.com/2010/09/30/how-to-encode-video-for-mobile-use/
它解决了问题。我的 mp4 文件现在可以在 iPhone 3gs 和 4 上读取。
I've experienced the same issue and yes it seems that it's an encoding issue. I followed the Universal Smartphone profile provided here :
http://blog.zencoder.com/2010/09/30/how-to-encode-video-for-mobile-use/
and it solved the problem. My mp4 file can now be read both on iPhone 3gs and 4.
出现此符号
如果您的 HTML
元素 iPhone 3GS 或 iPhone 4 这是因为这些手机将仅播放 HTML 视频,如果:
是使用 MPEG-4 H.264 编码的 MP4视频电平3 基线配置文件 + AAC 音频
我在 Miro Video Converter 上尝试了 iPhone 配置文件,但它不起作用。我发现可以转换为这种格式的最简单的转码器是 HandBrake。只需使用 iPod 预设进行转码即可支持 3GS 和 iPhone & 3GS。 iPod 预设为支持更高分辨率的 iPod 4+。
Apple 的 iPhone 4 规格:
https://support.apple.com/kb /SP587?viewlocale=en_US&locale=en_US
Apple 的 iPhone 3GS 规格:
https:// support.apple.com/kb/SP565?viewlocale=en_US&locale=en_US
If you are getting this symbol
for your HTML
<video>
element on an iPhone 3GS or iPhone 4 it's because those phones will only play HTML videos if:<source>
that is a MP4 encoded with MPEG-4 H.264 Video Level 3 Baseline Profile + AAC AudioI tried the iPhone profile on Miro Video Converter and it didn't work. The easiest transcoder I've found that will convert to this format is HandBrake. Just transcode using the iPod preset for 3GS support and iPhone & iPod preset for iPod 4+ support with higher resolution.
iPhone 4 specs from Apple:
https://support.apple.com/kb/SP587?viewlocale=en_US&locale=en_US
iPhone 3GS specs from Apple:
https://support.apple.com/kb/SP565?viewlocale=en_US&locale=en_US
我遇到了同样的问题,但所有这些修复都不起作用。最终起作用的是删除我对这些文件使用的 htaccess 保护。前面的答案是正确的,但这将解决任何 htaccess 安全问题。
I was experiencing the same issue but all these fixes weren't working. What did work eventually was to remove the htaccess protection I was using for those files. The previous answer is right, but this will fix any htaccess security problems.