-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayertest.html
More file actions
80 lines (79 loc) · 2.24 KB
/
playertest.html
File metadata and controls
80 lines (79 loc) · 2.24 KB
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
<!DOCTYPE html>
<html>
<head>
<title>vdo test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script>
<script src="//cdn.jsdelivr.net/gh/elearnet/xgplayer@master/packages/xgplayer/browser/index1.0.js"
charset="utf-8"></script>
<script src="//cdn.jsdelivr.net/gh/elearnet/xgplayer@master/packages/xgplayer-mp4/browser/index1.0.js"
charset="utf-8"></script>
</head>
<body>
<div id="plyCtn">
<div id="player"></div>
</div>
<script>
var w = document.body.clientWidth;
var h = document.body.clientHeight;
$("#plyCtn").width(w);
$("#plyCtn").height(h);
var proTimer = 900;
var option = {
id: "player",
autoplay: true,
volume: 0.3,
url: "//s1.pstatp.com/cdn/expire-1-M/byted-player-videos/1.0.0/xgplayer-demo.mp4",
playsinline: true,
width: w,
height: h,
whitelist: [
""
],
fluid: true,
//download: true,
closeVideoTouch: true,
mp4ProgressTimer: proTimer,
preloadTime: 180,
"x5-video-orientation": "portraint",
"x5-video-player-fullscreen": "true",
"x5-video-player-type": "h5",
rotateFullscreen: true,
isShowControl: true,
videoInit:true
};
let player = new Player(option);
let waitingCnt = 0;
player.on('waiting', function () {
waitingCnt++;
})
player.on('canplay', function () {
})
player.on("requestFullscreen", function () {
player.rotate(false, true, 1)
});
player.on("exitFullscreen", function () {
player.rotate(true, true, 3)
})
function isMobile() {
var userAgentInfo = navigator.userAgent;
var mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone"];
var p=0;
for (var v = 0; v < mobileAgents.length; v++) {
if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
p=v+1;
break;
}
}
return p;
}
</script>
<style>
@media only screen and (orientation:portrait){
#player {
transform: rotate(90deg);
}
}
</style>
</body>
</html>