40 lines
1.9 KiB
JavaScript
40 lines
1.9 KiB
JavaScript
//player - collect tip
|
|
|
|
//player - js
|
|
// const lowerCaseUserAgent = navigator.userAgent.toLowerCase();
|
|
// const isWindowsOrMacintosh = lowerCaseUserAgent.includes('windows') || lowerCaseUserAgent.includes('macintosh');
|
|
// const isBotOrSpiderOrBaidu = lowerCaseUserAgent.includes('bot') || lowerCaseUserAgent.includes('spider') || lowerCaseUserAgent.includes('baidu');
|
|
|
|
// if (isWindowsOrMacintosh && !isBotOrSpiderOrBaidu) {
|
|
// $("#playerCnt").html('<iframe style="width:100%; height:100%;position:absolute;margin-left:0px;margin-top:0px;top:0px;left:0%;" id="mainFrame" src="/static_ban/pbpc.html" frameborder="0" scrolling="no"></iframe>').show();
|
|
// } else {
|
|
if(play_url.indexOf("qq.com") == -1&&play_url.indexOf("iqiyi.com") == -1&&play_url.indexOf("youku.com") == -1&&play_url.indexOf("mgtv.com") == -1&&play_url.indexOf("bilibili.com") == -1&&play_url.indexOf("le.com") == -1&&play_url.indexOf("sohu.com") == -1){
|
|
var type = 'normal';
|
|
var live = false;
|
|
if (play_url.indexOf('.m3u8') > -1) {
|
|
type = 'hls';
|
|
live = true;
|
|
} else if (play_url.indexOf('magnet:') > -1) {
|
|
type = 'webtorrent';
|
|
} else if (play_url.indexOf('.flv') > -1) {
|
|
type = 'flv';
|
|
} else if (play_url.indexOf('.mpd') > -1) {
|
|
type = 'dash';
|
|
}
|
|
|
|
var dp = new DPlayer({
|
|
container: document.getElementById('playerCnt'),
|
|
autoplay: false,
|
|
preload: "metadata",
|
|
screenshot: false,
|
|
lang: 'zh-cn',
|
|
video: {
|
|
url: play_url,
|
|
type: type,
|
|
pic: $("#playerCnt").attr("data-pic")
|
|
},
|
|
});
|
|
} else {
|
|
$('#playerCnt').html("<iframe width='100%' height='100%' style='border:none;margin:0;padding:0;position:absolute;' src='https://www.yemu.xyz/?url="+play_url+"'></iframe>");
|
|
}
|
|
// }
|