我有html5视频播放器:
<video width="185" height="104" autoplay="autoplay" loop>
<source src="comm.mp4" type="video/mp4" />
</video>这是一个5秒的视频。我想要循环,但我想静音这个视频一旦它已经第一次播放。
jQuery大师..。我在找你帮忙。
发布于 2016-02-10 00:29:36
正如注释中所写的,一种方法是在n秒钟后通过超时将视频设置为静音。我更喜欢这样的:
// use all videos with a loop attribute
// remove the attribute and replay on end event
$('video[loop]').bind('ended', function(){
// prop or attr depends on your jquery version
$(this).attr('muted', true);
this.play();
}).removeAttr('loop');https://stackoverflow.com/questions/35304633
复制相似问题