首页 > Web开发 > 详细

HTML5新标签

时间:2016-07-18 15:51:54      阅读:278      评论:0      收藏:0      [点我收藏+]

HTML5的设计目的是为了在移动设备上支持多媒体。新的语法特征被引进以支持这一点,如video、audio和canvas 标记。

下面是我用新标签做的小案列:

 

技术分享

 

 

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
				#video{
					border: 5px outset #EE82EE;
					 margin-top: 30px;
					 border-radius: 20px;

				}
				#button{
					border: 1px dashed #800080;
					border-radius: 50px;
					background-color: #EE82EE ;
				}
		</style>
	</head>
	<body>
		<center>
			<video src="madia/video.mp4" id="video" controls="controls"></video>
			</br>
			<button id="button" onclick="ks()">开始</button>
			<button id="button" onclick="zt()">暂停</button>
			<button id="button" onclick="upper()">加大音量</button>
			<button id="button" onclick="lower()">减小音量</button>
			<button id="button" onclick="jingyin(this)">静音</button>
			<button id="button" onclick="jiasu(this)">加速</button>
			<button id="button" onclick="jiansu()">减速</button>
		</center>
		
		<script>
		var video=document.getElementById("video");
			function ks(){
				video.play();
			}
			function zt(){
				video.pause();
			}
			function upper(){
				video.volume+=0.2;//video.volume+0.2
			}
			function lower(){
				video.volume-=0.2;
			}
			
			function jingyin(obj){
				if(video.muted){
					obj.innerHTML="静音";
					video.muted=false;//打开音量
				}else{
					obj.innerHTML="声音";
					video.muted="true";//关闭音量
				}
			}
			
			
			function jiasu(){
				video.currentTime+=2;
			}
			function jiansu(){
				video.currentTime-=2;
			}
			
		</script>
	</body>
</html>

 这就是我做的一个小播放器,如有不懂,可以问我哦!

HTML5新标签

原文:http://www.cnblogs.com/996158041chenlu/p/5680081.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!