<!DOCTYPE html>
|
<html lang="en">
|
<head>
|
<meta charset="UTF-8">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
|
<title>ByDansin</title>
|
<meta name="format-detection" content="telephone=no">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
<meta name="msapplication-tap-highlight" content="no">
|
<style>
|
html, body {
|
margin: 0;
|
padding: 0;
|
height: 100%;
|
}
|
.vcp-error-tips {
|
color: #fff;
|
}
|
#video-container {
|
width: 100%;
|
height: 100%;
|
}
|
</style>
|
</head>
|
<body>
|
<div id="video-container" style="margin: 0px auto;"></div>
|
<script src="https://imgcache.qq.com/open/qcloud/video/vcplayer/TcPlayer-2.3.2.js"></script>
|
<script>
|
// 获取url
|
function getParams(name) {
|
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
|
|
var r = window.location.search.substr(1).match(reg);
|
if (r != null) {
|
return decodeURIComponent(r[2]);
|
}
|
return null;
|
}
|
var url = getParams('url');
|
/**
|
* 视频类型播放优先级
|
* mobile :m3u8>mp4
|
* PC :RTMP>flv>m3u8>mp4
|
*/
|
var options = {
|
m3u8: url || 'http://hls01open.ys7.com/openlive/d6466d56c2184cb09f9be0fe05fda81f.m3u8' ,
|
autoplay: true,
|
wording: {
|
2032: '请求视频失败,请检查网络',
|
2048: '请求m3u8文件失败,可能是网络错误或者跨域问题'
|
},
|
listener: function (msg) {
|
if(msg.type == 'load') {
|
|
}
|
}
|
};
|
window.tcplayer = new TcPlayer('video-container', options);
|
</script>
|
</body>
|
</html>
|