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="" height="">你的浏览器不支持</video>
</body>
</html>
效果:
2017-09-03 17:15:24