HTML embed autoplay=“false”, but still plays automatically

后端 未结 8 1502
情深已故
情深已故 2020-11-30 11:25

On the front page of this website, there is a sticky post titled \"National Radio Advertising Campaign ForACURE\" which contains the following HTML:



        
相关标签:
8条回答
  • 2020-11-30 12:05
    <video width="320" height="240" controls autoplay>
    <source src="movie.mp4" type="video/mp4"> Your browser does not support the video tag.
    </video>
    

    Remove autoplay if you want to disable auto playing video.

    0 讨论(0)
  • 2020-11-30 12:06

    Just set using JS as follows:

    <script>
        var vid = document.getElementById("myVideo");
        vid.autoplay = false;
        vid.load();
    </script>
    

    Set true to turn on autoplay. Set false to turn off autoplay.

    http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_av_prop_autoplay

    0 讨论(0)
提交回复
热议问题