HTML 音频/视频 document pause()方法是暂停当前的音频或视频。
播放或暂停视频
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>播放或暂停视频案例-HTML教程www.xuandaima.com</title> </head> <body> <button onclick="playVideo()" type="button">播放视频</button> <button onclick="pauseVideo()" type="button">暂停视频</button> <br> <video id="video"> <source src="/Template/Test/src/mov_bbb.mp4" type="video/mp4"> 您的浏览器不支持 HTML5 video 标签。 </video> <script> var myVideo=document.getElementById("video"); function playVideo() { myVideo.play(); } function pauseVideo() { myVideo.pause(); } </script> </body> </html>
音频对象/视频对象.pause()