html5中play 方法和pause方法在video的应用

play();播放

pause();暂停

代码实例:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>视频播放</title>
</head>
<body>
<script>
      window.onload =function(){
          var ov=document.getElementById("a1");
          ov.onmouseover=function() {
               this.play();
          }
          ov.onmouseout =function() {
                this.pause();
          }

      };

</script>

<video   id="a1"  src="陈奕迅 - 陪你度过漫长岁月.mp4"  controls   loop     width="400"  height="400">你的浏览器不支持</video>
</body>
</html>

效果:

 2017-09-03  17:15:24

原文地址:https://www.cnblogs.com/guangzhou11/p/7470068.html