mgtv - 素材

当前位置:Gxlcms > 播放器 > html5移动端单视频播放代码

html5移动端单视频播放代码

时间:2021-07-01 10:21:17 帮助过:0人阅读

html5移动端单视频播放代码 html5移动端单视频播放代码是一款基于zy.media.js插件实现的手机端视频播放器。
<head>
<meta charset="utf-8">
<title>html5移动端单视频播放代码 - mgtv素材</title>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">

<script src="js/jquery-1.8.3.min.js"></script>

<link rel="stylesheet" href="zy.media.min.css">
<link href="" rel="stylesheet">
<style type="text/css">
#modelView{background-color:#DDDDDD;z-index:0;opacity:0.7;height: 100%;width: 100%;position: relative;}
.playvideo{padding-top: auto;z-index: 9999;position: relative;}
.zy_media{z-index: 999999999}
</style>

</head>
<body onmousewheel="return false;">

<div class="playvideo">
<div class="zy_media">
	<video poster="https://r1.ykimg.com/05420408584A363C6A0A47047DD24931" data-config='{"mediaTitle": "测试视频--视频"}'>
		<source src="http://www.w3cschool.cc/try/demo_source/mov_bbb.mp4" type="video/mp4">
	  您的浏览器不支持HTML5视频
 </video>
</div>
<div id="modelView">&nbsp;</div>
</div>

<script src="zy.media.min.js"></script>
<script>
//document.documentElement.style.overflow='hidden';
document.body.style.overflow='hidden';
zymedia('video',{autoplay: true});
var screenheight = window.screen.height/2;
$("#modelView").width(window.screen.width);
$("#modelView").height(window.screen.height);
var videoheight = $(".zy_media").height()/2;
var padding_top = screenheight-videoheight;
$(".playvideo").css({"top":padding_top});
$("#modelView").css({"margin-top":-1*(padding_top+$(".zy_media").height())});
</script>


</body>