<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="js/my.js"></script>
<style>
.cont{
width: 700px;
height: 400px;
position: relative;
text-align: center;
margin: 0 auto;
}
</style>
</head>
<body>
<div class="cont">
<video id="video1" src="img/video.mp4" width="500" height="300"></video>
<div>
<button οnclick="p()">播放/暂停</button>
<button οnclick="large()">放大</button>
<button οnclick="little()">缩小</button>
<button οnclick="commen()">普通</button>
</div>
</div>
</body>
</html>
function p(){
var v=document.getElementById("video1");
if (video1.paused)
v.play();
else
v.pause();
}
function large(){
var v=document.getElementById("video1");
v.style.height=v.height*1.2+'px';
v.style.width=v.width*1.2+'px';
}
function commen(){
var v=document.getElementById("video1");
if(v.style.height!=v.height*700+'px'&&v.style.width!=v.width*400+'px'){
v.style.height=v.height+'px';
v.style.width=v.width+'px';
}
}
function little(){
var v=document.getElementById("video1");
v.style.height=v.height*0.8+'px';
v.style.width=v.width*0.8+'px';
}