-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.js
98 lines (87 loc) · 1.85 KB
/
player.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
function Request(strName) {
var strHref = location.href;
var intPos = strHref.indexOf("?");
var strRight = strHref.substr(intPos + 1);
var arrTmp = strRight.split("&");
for (var i = 0; i < arrTmp.length; i++) {
var arrTemp = arrTmp[i].split("=");
if (arrTemp[0].toUpperCase() == strName.toUpperCase())
return arrTemp[1];
}
return "";
}
var id = Request("id");
var s = Request("s");
{
var dp = new DPlayer({
container: document.getElementById('live'),
theme: '#FFFFFF',
live: true,
hotkey: false,
autoplay: true,
screenshot: true,
volume: 1.0,
// 视频右键菜单
contextmenu: [
{
text: '229资料站',
link: 'https://https://229.junbo.wang',
},
{
text: '加载不出来再次右键',
link: '',
},
{
text: '选重新加载框架',
link: '',
},
],
video: {
quality:
[{ name: '', url: s, type: 'hls', }],
pic: 'https://ae01.alicdn.com/kf/Hcb6d59ba2e394fd6b9be11b16a64c917L.jpg',
defaultQuality: 0,
}
})
;
}
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i].trim();
if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
}
return "";
}
disable = getCookie('disable_autoplay');
//alert(disable);
if (disable == "true") {
}
else {
dp.play();
}
window.onload = function () {
var oBox = document.getElementById('drag');
oBox.ondragenter = function () {
return false;
};
oBox.ondragover = function () {
return false;
};
oBox.ondragleave = function () {
return false;
};
oBox.ondrop = function (ev) {
var data = ev.dataTransfer.getData("text");
//alert(data);
location.replace("player.html?s=" + data);
return false;
};
};
dp.on('pause', function () {
pausead.style.display = "block";
});
dp.on('play', function () {
pausead.style.display = "none";
});