我在首页上放了一个视频(HTML5标签)。它在Mozilla和Chrome中运行良好,但在Safari浏览器窗口中无效(版本5.1.7) 这是网站URL
以下是我提出的代码:
<div id="slideshow" class="clearfix">
<div id="home_video" class="clearfix" align="center">
<div class="video-js-box">
<video class="video-js" width="100%" height="100%" autoplay="true" preload="auto" tabindex="0" muted autoplay loop>
<source type="video/mp4; codecs="avc1.42E01E, mp4a.40.2"" src="<?php echo site_url();?>/wp-content/uploads/parklane_low1.mp4"></source>
<source type="video/webm; codecs="vp8, vorbis"" src="<?php echo site_url();?>/wp-content/uploads/parklane_low1.webmsd.webm"></source>
<source type="video/ogg; codecs="theora, vorbis"" src="<?php echo site_url();?>/wp-content/uploads/parklane_low1.oggtheora.ogv"></source>
<object id="flash_fallback_1" class="vjs-flash-fallback" width="100%" height="100%" type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf">
<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
<param name="allowfullscreen" value="false" />
<param name="flashvars" value='config={"playlist":["http://www.yourwebsite.com/cms/video/poster.jpg", {"url": "<?php echo site_url();?>/wp-content/uploads/parklane_low1.mp4","autoPlay":true}]}' />
</object>
</video>
</div>
</div>
</div>
请为此提供任何解决方案。
答案 0 :(得分:0)
尝试除HTML5视频代码之外的iframe,此处为
的代码 <div id="slideshow" class="clearfix">
<div id="home_video" class="clearfix" align="center">
<div class="video-js-box">
<iframe class="video-js" src="<?php echo site_url();?>/wp-content/uploads/parklane_low1.mp4" height="100%" width="100%"></iframe>
</div>
</div>
</div>
如果你用js改变,请使用$(window).load 除了$(document).ready event。它适用于所有浏览器。