HTML5视频实现在ipad中不起作用

时间:2015-06-02 06:32:54

标签: html5

HTML5视频隐私在ipad中无法通过以下代码运行。

<video width="100%" height="340" id="player1" controls preload="none"  poster="../media/echo-hereweare.jpg" autoplay>

    <source src="video/1x1trial444.mp4"  type="video/mp4" />
    <!-- WebM/VP8 for Firefox4, Opera, and Chrome -->
    <source type="video/webm" src="video/1x1trial444.webm" />
    <!-- Ogg/Vorbis for older Firefox and Opera versions -->
    <source type="video/ogg" src="video/1x1trial444.ogg" />         

</video>

1 个答案:

答案 0 :(得分:0)

尝试在源上添加编解码器信息,并确保mp4使用基线级别3编码(似乎是旧设备的更安全选择)

<source src="video/1x1trial444.mp4" type='video/mp4;codecs="avc1.42E01E, mp4a.40.2"' />
<!-- WebM/VP8 for Firefox4, Opera, and Chrome -->
<source src="video/1x1trial444.webm" type='video/webm;codecs="vp8, vorbis"' />