简体   繁体   中英

Why this video won't start playing automatically?

Seek time is at 10 secs position, but it won't start playing automatically.
Why? and how can I fix?

My current code is just like this

<script type="text/javascript">
    document.getElementById("video").addEventListener("loadedmetadata", function() {
        this.currentTime = 10;
        this.autoplay = true;
    }, false);
</script>

Try this:

<script type="text/javascript">
document.getElementById("video").addEventListener("loadedmetadata", function() {
     this.currentTime = 10;
     this.play();
}, false);</script>

仅供参考,某些移动设备不支持视频的自动播放设置-例如iPad,iPhone

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM