-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmobileplay.html
More file actions
93 lines (69 loc) · 2.57 KB
/
Copy pathmobileplay.html
File metadata and controls
93 lines (69 loc) · 2.57 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
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE HTML>
<html>
<head>
<title>Video Play</title>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<link rel="stylesheet" href="/static/cntv/styles.css"/>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css"/>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>
<div id="videoPage" data-role="page" data-add-back-btn="true">
<div id="ytapiplayer">Loading videos.</div>
<script language="javascript" type="text/javascript">
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// 3. This function creates an <iframe> (and YouTube player)
// after the API code downloads.
var normalplayer;
var id;
id=getUrlVars()['video'];
var viewportheight = window.innerHeight;
function onYouTubeIframeAPIReady() {
normalplayer = new YT.Player('ytapiplayer', {
height: String(viewportheight) + 'px',
width: '100%',
videoId:id,
playerVars: {
'start': 0,
'autoplay': 1,
'controls': 1,
'fs': 1,
'autohide': 1,
'enablejsapi': 1,
'iv_load_policy': 3,
'rel': 0,
'hd': 1
},
events: {
'onReady': onPlayerReady,
'onError': onPlayerError,
'onStateChange': onPlayerStateChange
}
});
}
function onPlayerError(event) {
}
// 4. The API will call this function when the video player is ready.
function onPlayerReady(event) {
}
function onPlayerStateChange(event) {
}
function getUrlVars() {
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
</script>
</div>
</body>
</html>