编辑下面的代码:【加编码】
<html> <body> <video id="myVideo" width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> 您的浏览器不支持 video 标签。 </source></source></video><br> <button onclick="enableLoop()" type="button">启用循环播放</button> <button onclick="disableLoop()" type="button">禁用循环播放</button> <button onclick="checkLoop()" type="button">查看循环播放状态</button> <script> var x = document.getElementById("myVideo"); function enableLoop() { x.loop = true; x.load(); } function disableLoop() { x.loop = false; x.load(); } function checkLoop() { alert(x.loop); } </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂