forked from thatguystone/flowplayer-ima
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathima.html
53 lines (46 loc) · 1.63 KB
/
ima.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Ads Test</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="flowplayer-3.2.6.js"></script>
<script type="text/javascript">
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
gads.src = 'http://www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>
</head>
<body>
<div id="player" style="width: 400px; height: 300px; float: left;"></div>
<div id="playerCompanion" style="width: 300px; height: 250px; float: left; margin-left: 100px; border: 1px solid #f00;"></div>
</body>
<script type="text/javascript">
//see: http://code.google.com/apis/ima/docs/sdks/googleflashas3_companions.html#example2
//and: http://www.google.com/support/dfp_premium/bin/answer.py?hl=en&answer=1191131
googletag.cmd.push(function() {
console.debug('setting up companion slots');
var adSlot1 = googletag.defineSlot('some/spot', [300, 250], 'playerCompanion');
adSlot1.addService(googletag.companionAds());
googletag.enableServices();
});
f = flowplayer('player', 'flowplayer.commercial.swf', {
debug: true,
log: {level: 'error', filter: '*'},
plugins: {
ima: {
onAdLoaded: console.log
}
},
onLoad: function() {
f.getPlugin('ima').playAd('http://url/to/some/vast.xml');
}
});
</script>
</html>