W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <body> <button onclick="getPlaySpeed()" type="button">播放速度是多少?</button> <button onclick="setPlaySpeed()" type="button">将视频设置为以慢速播放</button> <br /> <br /> <video id="video1" controls="controls"> <source src="/example/html5/mov_bbb.mp4" type="video/mp4"> <source src="/example/html5/mov_bbb.ogg" type="video/ogg"> Your browser does not support HTML5 video. </video> <script> myVid=document.getElementById("video1"); function getPlaySpeed() { alert(myVid.playbackRate); } function setPlaySpeed() { myVid.playbackRate=0.5; } </script> </body> </html>