视频断点播放:h5+jquery

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<script type="text/javascript" src="js/jquery.js" ></script>
	<body>      
	    <video id="myvideo" width="80%" height="80%" controls="controls" poster="img/cars.png">
	    	<source src="mycdn/bfcs.mp4" type="video/mp4">
	    </video>
	    <script type="text/javascript">
	        var video = document.getElementById(‘myvideo‘);
	        var currentTime = localStorage.getItem("currentTime");
	        console.log(currentTime);
	        video.addEventListener("loadedmetadata",function(){
	            this.currentTime = currentTime;
	        });
	        video.addEventListener("timeupdate",function(){
	            var currentTime = Math.floor(video.currentTime);
	            localStorage.setItem("currentTime",currentTime);
	            console.log(localStorage.getItem("currentTime"));
	        });
	    </script> 
	</body>
</html>

视频断点播放:h5+jquery

上一篇:guid转int


下一篇:Loadrunner模拟JSON接口请求进行测试