forked from googleads/googleads-ima-html5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
96 lines (85 loc) · 3.02 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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css"/>
<script src="https://imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
<script src="application.js"></script>
<script src="ads.js"></script>
<script src="video_player.js"></script>
<!-- GPT Companion Code -->
<!-- Initialize the tagging library -->
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
gads.src = 'https://www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>
<!-- Register your companion slots -->
<script>
googletag.cmd.push(function() {
// Supply YOUR_NETWORK/YOUR_UNIT_PATH in place of 6062/iab_vast_samples.
googletag.defineSlot('/6062/iab_vast_samples', [728, 90], 'companionDiv')
.addService(googletag.companionAds())
.addService(googletag.pubads());
googletag.companionAds().setRefreshUnfilledSlots(true);
googletag.pubads().enableVideoAds();
googletag.enableServices();
});
</script>
<title>IMA HTML5 SDK Playlist Demo</title>
</head>
<body>
<div id="container">
<header>IMA HTML5 SDK Playlist Demo</header>
<div id="videoplayer">
<video id="content">
<source src="https://storage.googleapis.com/gvabox/media/samples/stock.mp4"></source>
</video>
<div id="adcontainer">
</div>
<button id="playpause" title="Play/Pause">▶</button>
<button id="replay" title="Replay">↺</button>
<button id="fullscreen" title="Full screen">[ ]</button>
</div>
<div id="customClick">
<div id="customClickTextWrapper">Click here for more info on your ad.</div>
</div>
<!-- Declare a div where you want the companion to appear. Use
googletag.display() to make sure the ad is displayed. -->
<div id="companionDiv">
<script>
// Using the command queue to enable asynchronous loading.
// The unit will not actually display now - it will display when
// the video player is displaying the ads.
googletag.cmd.push(function() { googletag.display('companionDiv'); });
</script>
</div>
<div id="playlistDiv">
<div class="playlistItem">
<img id="0" class="playlistImg" src="img/android_preview.jpg" />
Video 1
</div>
<div class="playlistItem">
<img id="1" class="playlistImg" src="img/doubleclick_preview.jpg" />
Video 2
</div>
</div>
<div id="console">
Welcome to IMA HTML5 SDK Demo!
</div>
<footer>Copyright (C) 2013 Google Inc.</footer>
</div>
<script>
var application = null;
window.onload = function() {
application = new Application();
};
</script>
</body>
</html>