html5视频处理

<video src="视频文件路径"  width="" height="" controls="controls">

//对视频点击设置

<script type="text/javascript">
var myVideo=document.getElementById("视频id");
// 播放/暂停
function playPause()
{
if (myVideo.paused)
myVideo.play();
else
myVideo.pause();
}
// 屏幕变大
function makeBig()
{
myVideo.width=560;
}
// 屏幕中
function makeSmall()
{
myVideo.width=320;
}
// 屏幕小
function makeNormal()
{
myVideo.width=420;
}
</script>

//设置常用按钮
<div style="text-align:center;">
<button onclick="playPause()">播放/暂停</button>
<button onclick="makeBig()">大</button>
<button onclick="makeNormal()">中</button>
<button onclick="makeSmall()">小</button>
<br />
<video id="" width="" >
<source src="视频路径" type="video/mp4" />
</video>
</div>

 

posted on 2020-03-01 21:57  晓晓的明星  阅读(119)  评论(0)    收藏  举报

导航