增加视频播放页面
This commit is contained in:
parent
a4736914c9
commit
7a6f5ee2e1
18
gulpfile.js
18
gulpfile.js
@ -110,5 +110,21 @@ const obfuscatorOptions = {
|
|||||||
return gulp.src(['assets/**/*'])
|
return gulp.src(['assets/**/*'])
|
||||||
.pipe(gulp.dest('dist/assets'));
|
.pipe(gulp.dest('dist/assets'));
|
||||||
})
|
})
|
||||||
gulp.task('default', ['disthtml', 'distfc', 'distgba', 'distgba2', 'assets']);
|
// movie
|
||||||
|
gulp.task('distmoviejs', function() {
|
||||||
|
return gulp.src(['movie/js/*.js'])
|
||||||
|
.pipe(stripDebug())
|
||||||
|
.pipe(gulp.dest('dist/movie/js'));
|
||||||
|
});
|
||||||
|
gulp.task('distmoviecss', function() {
|
||||||
|
return gulp.src(['movie/css/**/*.css'])
|
||||||
|
.pipe(gulp.dest('dist/movie/css'));
|
||||||
|
})
|
||||||
|
gulp.task('distmoviestatic', function() {
|
||||||
|
return gulp.src(['movie/img/**/*'])
|
||||||
|
.pipe(gulp.dest('dist/movie/img'));
|
||||||
|
})
|
||||||
|
gulp.task('distmovie', ['distmoviejs', 'distmoviecss', 'distmoviestatic'])
|
||||||
|
|
||||||
|
gulp.task('default', ['disthtml', 'distfc', 'distgba', 'distgba2', 'distmovie', 'assets']);
|
||||||
// gulp.task('default', ['disthtml', 'distfc', 'assets']);
|
// gulp.task('default', ['disthtml', 'distfc', 'assets']);
|
||||||
|
1
movie/css/DPlayer.min.css
vendored
Normal file
1
movie/css/DPlayer.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
movie/img/video_play.png
Normal file
BIN
movie/img/video_play.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
71
movie/index.html
Normal file
71
movie/index.html
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
|
||||||
|
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
|
||||||
|
<meta content="telephone=no" name="format-detection">
|
||||||
|
<link href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAMAAAAoyzS7AAAAA1BMVEU8sDU4fUu1AAAADUlEQVR42gECAP3/AAAAAgABUyucMAAAAABJRU5ErkJggg==" rel="icon" type="image/x-icon" />
|
||||||
|
<title>加载中...</title>
|
||||||
|
<link rel="stylesheet" href="./css/DPlayer.min.css">
|
||||||
|
<script type="text/javascript" src="./js/hls.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/flv.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/DPlayer.min.js"></script>
|
||||||
|
<style>
|
||||||
|
html,body{padding:0;margin:0;background: #000000;}
|
||||||
|
.content{background-color:black;padding: 0;margin-top:calc(50vh - 135px);width:100%;height: 270px;color:#999;}
|
||||||
|
|
||||||
|
#mask{position:fixed;width:100%;height:100%;left:0;top:0;z-index:95;background:rgba(255,255,255,0.2);}
|
||||||
|
#mask img{position:absolute;left:calc(50vw - 9vw);top:calc(50vh - 9vw); width:18vw;}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div style="position:fixed;width:100%;height:100%;left:0;top:0;background:#000;z-index:1;">
|
||||||
|
<div id="a1" class="content"></div>
|
||||||
|
</div>
|
||||||
|
<div id="mask" onclick="play()"><img src="./img/video_play.png" /></div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
function getParameter(val) {
|
||||||
|
var uri = window.location.search, re = new RegExp("" + val + "=([^&?]*)", "ig");
|
||||||
|
return ((uri.match(re)) ? (uri.match(re)[0].substr(val.length + 1)) : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setTitle(title) {
|
||||||
|
document.title = title;
|
||||||
|
if (/ip(hone|od|ad)/i.test(navigator.userAgent)) {
|
||||||
|
var i = document.createElement('iframe');
|
||||||
|
i.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAMAAAAoyzS7AAAAA1BMVEU8sDU4fUu1AAAADUlEQVR42gECAP3/AAAAAgABUyucMAAAAABJRU5ErkJggg==';
|
||||||
|
i.style.display = 'none';
|
||||||
|
i.onload = function () {
|
||||||
|
setTimeout(function () {
|
||||||
|
i.remove();
|
||||||
|
}, 9)
|
||||||
|
};
|
||||||
|
document.body.appendChild(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var param = JSON.parse(decodeURIComponent(getParameter("param")));
|
||||||
|
setTitle(param.name);
|
||||||
|
window.dp = new DPlayer({
|
||||||
|
element: document.getElementById("a1"),
|
||||||
|
autoplay: false,
|
||||||
|
video: {
|
||||||
|
url: param.url,
|
||||||
|
type: 'auto'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dp.on('play', function () {
|
||||||
|
if (document.getElementById("mask")) {
|
||||||
|
document.getElementById("mask").remove()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function play() {
|
||||||
|
dp.play();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
1
movie/js/DPlayer.min.js
vendored
Normal file
1
movie/js/DPlayer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
movie/js/flv.js
Normal file
6
movie/js/flv.js
Normal file
File diff suppressed because one or more lines are too long
1
movie/js/hls.js
Normal file
1
movie/js/hls.js
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user