1.0.2 video视频标签

1.0.2 视频
HTML5 规定了一种通过 video 元素来包含视频的标准方法。

--源代码:video.html
<html>
<body>
<video src="movie.ogg" controls="controls" width="320" height="240">
Your browser does not support the video tag.
</video>
<body>
<html>

IE8不支持video元素。在 IE 9 中,将提供对使用 MPEG4 的 video 元素的支持。


==============================================
<video> - 使用 DOM 进行控制:
--源码 \source\html5\video.html

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function playPause()
{
var myVideo=document.getElementById("video1");
if (myVideo.paused){
myVideo.play();
}
else{
myVideo.pause();
}

}

function makeBig(){
var myVideo=document.getElementById("video1");
myVideo.width=520;
}

function makeNormal(){
var myVideo=document.getElementById("video1");
myVideo.width=420;
}

function makeSmall(){
var myVideo=document.getElementById("video1");
myVideo.width=320;
}
</script>
</head>
<body>

<div style="text-align:center;">
<button οnclick="playPause()">播放/暂停</button>
<button οnclick="makeBig()">大</button>
<button οnclick="makeNormal()">中</button>
<button οnclick="makeSmall()">小</button>
<br />
<video id="video1" width="420" style="margin-top:15px;">
<source src="mov_bbb.mp4" type="video/mp4" />
<source src="movie.ogg" type="video/ogg" />
Your browser does not support HTML5 video.
</video>
</div>


</body>
</html>


@dianxinxinxiyuan.xiuyanxilu.pudongqu.shanghai
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值