forked from ooyala/html5-skin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiframe.html
60 lines (56 loc) · 2.55 KB
/
iframe.html
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
<!DOCTYPE html>
<html style="padding:0; margin:0; width:100%; height:100%; overflow:hidden">
<head>
<script src="//player.ooyala.com/static/v4/stable/4.3.3/core.min.js"></script>
<script src="//player.ooyala.com/static/v4/stable/4.3.3/video-plugin/main_html5.min.js"></script>
<script src="//player.ooyala.com/static/v4/stable/4.3.3/video-plugin/osmf_flash.min.js"></script>
<script src="//player.ooyala.com/static/v4/stable/4.3.3/video-plugin/bit_wrapper.min.js"></script>
<script src="//player.ooyala.com/static/v4/stable/4.3.3/skin-plugin/html5-skin.min.js"></script>
<link rel="stylesheet" href="//player.ooyala.com/static/v4/stable/4.3.3/skin-plugin/html5-skin.min.css"/>
</head>
<body style="padding:0; margin:0; width:100%; height:100%; overflow:hidden">
<div id='container' style='width:100%; height:100%;'></div>
<script>
var queryParams = window.location.href;
var playerParam = {
"pcode": queryParams.match(/pcode=([^&]*)/)[1],
"playerBrandingId": queryParams.match(/pbid=([^&]*)/)[1],
"skin": {
"config": "//player.ooyala.com/static/v4/stable/4.3.3/skin-plugin/skin.json",
"inline": {"shareScreen": {"embed": {"source": "<iframe width='640' height='480' frameborder='0' allowfullscreen src='//player.ooyala.com/static/v4/stable/4.3.3/skin-plugin/iframe.html?ec=<ASSET_ID>&pbid=<PLAYER_ID>&pcode=<PUBLISHER_ID>'></iframe>"}}}
}
};
// Parse docUrl
var docUrl = undefined;
if (!!queryParams.match(/docUrl=([^&]*)/)) {
playerParam["docUrl"] = decodeURIComponent(queryParams.match(/docUrl=([^&]*)/)[1]);
}
// Parse standard Ooyala player runtime options
var queryTokens = queryParams.split(/[\?\&]/);
for (var i=0; i<queryTokens.length; i++) {
try {
var match = queryTokens[i].match(/^options\[([^\]]+)\]=(.+)/);
if (match) {
var currentLevel = playerParam;
var keySplits = match[1].split(".");
while (keySplits.length > 1) {
var key = keySplits.shift();
if (currentLevel[key] === undefined)
currentLevel[key] = {};
currentLevel = currentLevel[key];
}
if (typeof currentLevel === 'string')
throw("Exception: Invalid query parameter");
currentLevel[keySplits[0]] = decodeURIComponent(match[2]);
}
}
catch (e) {
throw("Exception: Invalid query parameter");
}
}
OO.ready(function() {
window.pp = OO.Player.create('container', queryParams.match(/ec=([^&]*)/)[1], playerParam);
});
</script>
</body>
</html>