6

美好的一天,我一直在研究这个项目并学习如何在 ipad 和所有其他浏览器上放置视频。

但是在为此编写代码之后,我注意到我从 iPad 获得的唯一内容是视频的第一个关键帧,但视频没有播放。当我按下出现在 ipad 屏幕上的“播放”按钮时,视频不会只是播放。奇怪的是,脚本有一个自动播放命令。

这个脚本有什么问题?有没有更好的方法来做到这一点?我花了太多时间在这上面,我无法完成它。我在适用于 Windows、Firefox、Internet Explorer 的 Safari 上检查了这个,它在除 iPad 之外的任何地方都可以使用。

<video controls width="920px" height="560px" autoplay>  
<!-- if Safari/Chrome-->  
<source src="video.mp4" type="video/mp4" /> 
<source src="video.ogv" type="video/ogg" /> 
<!--If the browser doesn't understand the <video> element, then reference a Flash file. You could also write something like "Use a Better Browser!" if you're feeling nasty. (Better to use a Flash file though.)-->  
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="920" height="560" id="csSWF">
                <param name="movie" value="video_controller.swf" />
                <param name="quality" value="best" />
                <param name="bgcolor" value="#1a1a1a" />
                <param name="allowfullscreen" value="true" />
                <param name="scale" value="showall" />
                <param name="allowscriptaccess" value="always" />
                <param name="flashvars" value="autostart=true&showstartscreen=false&color=0x1A1A1A,0x1A1A1A" />
                <!--[if !IE]>-->
                <object type="application/x-shockwave-flash" data="video_controller.swf" width="920" height="560">
                    <param name="quality" value="best" />
                    <param name="bgcolor" value="#1a1a1a" />
                    <param name="allowfullscreen" value="true" />
                    <param name="scale" value="showall" />
                    <param name="allowscriptaccess" value="always" />
                    <param name="flashvars" value="autostart=true&showstartscreen=false&color=0x1A1A1A,0x1A1A1A" />
                <!--<![endif]-->
                    <div id="noUpdate">
                        <p>The video content presented here, requires a more recent version of the Adobe Flash Player. If you are using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by <a href="http://www.adobe.com/go/getflashplayer">downloading here</a>.</p>
                    </div>
                <!--[if !IE]>-->
                </object>
                <!--<![endif]-->
            </object>
            <script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
    swfobject.registerObject("csSWF", "9.0.28", "expressInstall.swf");
</script>
</video>
4

3 回答 3

7

mp4 视频的规格是什么(分辨率和配置文件)?iPad 不支持所有种类的 mp4。


您是否尝试过没有 flash 和 ogv 源的简单 html?


它看起来像你的 over sepc:

iPad 支持的视频格式

  • H.264 视频(高达 720p,每秒 30 帧;主配置文件级别 3.1,AAC-LC 音频高达 160 Kbps,48kHz,.m4v、.mp4 和 .mov 文件格式的立体声音频)
  • MPEG-4 视频,最高 2.5 Mbps,640 x 480 像素,每秒 30 帧,带有最高 160 Kbps 的 AAC-LC 音频的简单配置文件,48kHz,.m4v、.mp4 和 .mov 文件格式的立体声音频。
于 2010-10-11T14:11:28.350 回答
2

如果您还指定基本媒体编解码器,也许会更好

<source src="video.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
于 2010-10-11T13:25:11.227 回答
0

会是这样吗?

“如果您包含海报属性,iOS 将无法识别视频。该元素的海报属性允许您在视频加载时显示自定义图像,或者直到用户按下“播放”。这个错误在 iOS 4.0 中已修复,但用户升级还需要一段时间。”

在Dive into HTML5中找到它

于 2010-10-11T14:20:23.007 回答