来源:flash,as,js兴趣爱好者html5播放器教程2(为你的播放器添加事件) <!DOCTYPE html>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<body>
<video id="video1" style="margin:0 auto;width:400px;height:auto" controls=true onplay='play_()' onpause='pause_()'>
<!--controls是添加控制条。-->
<source src="http://www.w3school.com.cn/example/html5/mov_bbb.mp4" type="video/mp4" />
Your browser does not support HTML5 video.
</video>
</body>
<script>
function play_(){
alert('你播放了');
}
function pause_(){
alert('你暂停了');
}
</script>
</html>
html5播放器教程2(为你的播放器添加事件)
liujieheng
2013-12-08
|