GamePortrait/public/static/video.html

144 lines
3.1 KiB
HTML

<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="renderer" content="webkit">
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<title>player</title>
<style type="text/css">
*{
padding: 0;
margin: 0;
}
body{
overflow: hidden;
width: 100vw;
height: 100vh;
}
canvas{
display: block;
width: 100%;
height: 100%;
}
.spinner {
position: absolute;
top: 50%;
left: 50%;
width: 50px;
height: 50px;
text-align: center;
font-size: 10px;
z-index: 999;
margin-left: -25px;
margin-top: -25px;
}
.spinner > div {
background-color: #67CF22;
height: 100%;
width: 3px;
display: inline-block;
-webkit-animation: stretchdelay 1.2s infinite ease-in-out;
animation: stretchdelay 1.2s infinite ease-in-out;
}
.spinner .rect2 {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s;
}
.spinner .rect3 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
.spinner .rect4 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s;
}
.spinner .rect5 {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s;
}
@-webkit-keyframes stretchdelay {
0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
20% { -webkit-transform: scaleY(1.0) }
}
@keyframes stretchdelay {
0%, 40%, 100% {
transform: scaleY(0.4);
-webkit-transform: scaleY(0.4);
} 20% {
transform: scaleY(1.0);
-webkit-transform: scaleY(1.0);
}
}
</style>
</head>
<body oncontextmenu="return false;">
<canvas width="1280" height="760" id="video"></canvas>
<div class="spinner" id="loading">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
</body>
<script type="text/javascript" src="NodePlayer-full.min.js"></script>
<script type="text/javascript">
var videoUrl=getQueryString('url');
var isfirst=true;
window.onload=function(){
runEvery10Sec();
}
NodePlayer.debug(false);
var player = new NodePlayer();
player.setView("video");
player.setBufferTime(0);
player.setVolume(0.0);
player.start(videoUrl);
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
// 自动重新执行
function runEvery10Sec(){
setTimeout(runEvery10Sec,60*1000*9);
if(isfirst!=true){
player.start(videoUrl);
console.log("自动重新播放"+videoUrl);
}
isfirst=false;
}
player.on("videoInfo", () => {
setTimeout(function(){
document.getElementById("loading").style.display="none";
},1000)
});
player.on("error", () => {
console.log("链接超时");
setTimeout(function(){
document.getElementById("loading").style.display="block";
},1000)
});
player.on("stop", () => {
console.log("已经暂停!");
});
</script>
</html>