forked from bitmovin/bitmovin-player-web-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
169 lines (148 loc) · 5.5 KB
/
index.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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bitmovin Demo</title>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet">
<link rel="icon" type="image/png"
href="https://user-images.githubusercontent.com/4820162/31014892-8230d260-a51d-11e7-83f5-3861693d0ab6.png">
<!-- Bitmovin player -->
<script type="text/javascript" src="//cdn.bitmovin.com/player/web/8/bitmovinplayer.js"></script>
<script type="text/javascript" src="//imasdk.googleapis.com/js/sdkloader/ima3_dai.js"></script>
<script type="text/javascript" src="bitmovinPlayerDfpDai.js"></script>
<style>
body {
margin: 0;
padding: 0;
font-family: 'Open Sans', sans-serif;
color: #fff;
font-weight: 300;
}
body {
background: rgba(44, 131, 185, 1);
background: -moz-linear-gradient(left, rgba(44, 131, 185, 1) 0%, rgba(30, 171, 227, 1) 100%);
background: -webkit-gradient(left top, right top, color-stop(0%, rgba(44, 131, 185, 1)), color-stop(100%, rgba(30, 171, 227, 1)));
background: -webkit-linear-gradient(left, rgba(44, 131, 185, 1) 0%, rgba(30, 171, 227, 1) 100%);
background: -o-linear-gradient(left, rgba(44, 131, 185, 1) 0%, rgba(30, 171, 227, 1) 100%);
background: -ms-linear-gradient(left, rgba(44, 131, 185, 1) 0%, rgba(30, 171, 227, 1) 100%);
background: linear-gradient(to right, rgba(44, 131, 185, 1) 0%, rgba(30, 171, 227, 1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#2c83b9', endColorstr='#1eabe3', GradientType=1);
}
#wrapper {
background: url(https://user-images.githubusercontent.com/4820162/31014898-85ca9866-a51d-11e7-805d-66a7f3c0fd48.png);
height: 100vh;
}
#banner {
border-bottom: 1px solid #fff;
background-color: #1eabe3;
width: 100%
}
#banner h1 {
margin: 0;
padding: 30px;
}
.logo {
padding: 10px;
width: 25%;
min-width: 350px;
float: left;
margin: auto;
}
.title {
width: 75%;
white-space: nowrap;
}
.clear {
clear: both;
}
.content {
margin-bottom: 10em;
}
h1, h2, h3, p {
font-weight: 300;
text-align: center;
margin: 40px;
}
#player {
max-width: 900px;
width: 90%;
margin: auto;
-webkit-box-shadow: 0px 0px 56px 0px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0px 0px 56px 0px rgba(0, 0, 0, 0.75);
box-shadow: 0px 0px 56px 0px rgba(0, 0, 0, 0.75);
}
a {
color: #97d9ef;
font-weight: 400;
text-decoration: none;
}
a:hover {
color: #fff;
}
@media (max-width: 800px) {
.logo {
width: 100%;
}
.title {
display: none;
}
}
</style>
</head>
<body>
<div id="wrapper">
<div id="banner">
<div class="logo"><img
src="https://user-images.githubusercontent.com/4820162/31014894-83eb8082-a51d-11e7-8320-a364cd3fa976.png">
</div>
<div class="title"><h1></h1></div>
<div class="clear"></div>
</div>
<div class="container">
<h1>Google DFP DAI with the Bitmovin Player</h1>
<h2>Using assetKey: <span id="assetKey"></span></h2>
<div class="content">
<div class="player-wrapper">
<div id="player"></div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
// Google DFP demo asset key:
var assetKey = 'sN_IYUG8STe1ZzhIIE_ksA';
// Google DFP demo asset
var fallbackContent = 'http://storage.googleapis.com/testtopbox-public/video_content/bbb/master.m3u8';
// Enable providing assetKey via GET parameter
var providedAssetKey = location.search.match(/assetkey=(.+)/i);
if (providedAssetKey && providedAssetKey[1]) {
assetKey = providedAssetKey[1];
}
// Display which Google DFP asset key is used
document.querySelector('#assetKey').textContent = assetKey;
if (!window.google) {
// window.google does not exist if the IMA SDK could not be loaded. This usually happens if the user uses an ad blocker.
document.querySelector('.player-wrapper').innerHTML = '<h1>Please disable your ad blocker and refresh the page to watch this video.</h1>';
} else {
var conf = {
key: 'YOUR KEY HERE',
playback: {
muted: true,
timeShift: false
},
};
var source = {
dash: "https://bitdash-a.akamaihd.net/content/sintel/sintel.mpd",
hls: "https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8",
poster: "https://bitmovin.com/wp-content/uploads/2016/06/sintel-poster.jpg",
};
var player = new bitmovin.player.Player(document.getElementById('player'), conf);
player.load(source).then(function () {
bitmovinPlayerDfpDai(player, assetKey, fallbackContent);
});
}
</script>
</body>
</html>