mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-12 03:26:07 +08:00
v0.8.4 移动端页面扫码播放
This commit is contained in:
@@ -5,8 +5,52 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>ZY Player</title>
|
||||
<style>
|
||||
*{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
html,body{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
#mse{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="mse"></div>
|
||||
<script src="//cdn.jsdelivr.net/npm/xgplayer/browser/index.js" type="text/javascript"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/xgplayer-hls.js/browser/index.js" charset="utf-8"></script>
|
||||
<script>
|
||||
function get (name) {
|
||||
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
|
||||
var r = window.location.search.substr(1).match(reg);//search,查询?后面的参数,并匹配正则
|
||||
if(r!=null)return unescape(r[2]); return null;
|
||||
}
|
||||
let link = window.location.href
|
||||
let info = get('info')
|
||||
let time = get('time')
|
||||
let title = info.split('$')[0]
|
||||
let url = info.split('$')[1]
|
||||
let player = new window.HlsJsPlayer({
|
||||
id: 'mse',
|
||||
url: url,
|
||||
fluid: true,
|
||||
autoplay: true,
|
||||
playsinline: true,
|
||||
height: window.innerHeight,
|
||||
width: window.innerWidth,
|
||||
'x5-video-player-fullscreen': true,
|
||||
'x5-video-orientation': 'landscape'
|
||||
})
|
||||
player.on('play', function () {
|
||||
player.currentTime = time
|
||||
document.title = title
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user