forked from prebid/prebid.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpb-os-dfp.html
More file actions
78 lines (69 loc) · 1.94 KB
/
Copy pathpb-os-dfp.html
File metadata and controls
78 lines (69 loc) · 1.94 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
<!DOCTYPE html>
<html lang="en" class="html--no-js">
<head>
{% include head--common.html %} {% include prebidjs-non-prod.html %} {% include gptjs.html %}
<!--pbjs and player code -->
<script>
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
var PREBID_TIMEOUT = 1000;
var adUnits = [
{
code: "video1",
mediaTypes: {
video: {
context: "outstream",
playerSize: [640, 480],
mimes: ["video/mp4"],
protocols: [1, 2, 3, 4, 5, 6, 7, 8],
playbackmethod: [2],
skip: 1,
},
},
bids: [
{
bidder: "appnexus",
params: {
placementId: 13232385,
},
},
],
},
];
pbjs.que.push(function () {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: initAdserver,
});
});
function initAdserver() {
if (pbjs.initAdserverSet) return;
pbjs.initAdserverSet = true;
googletag.cmd.push(function () {
if (pbjs.libLoaded) {
pbjs.que.push(function () {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
} else {
googletag.pubads().refresh();
}
});
}
setTimeout(function () {
initAdserver();
}, PREBID_TIMEOUT);
googletag.cmd.push(function () {
var slot1 = googletag
.defineSlot("/19968336/prebid_outstream_adunit_1", [[1, 1]], "video1")
.addService(googletag.pubads());
googletag.pubads().disableInitialLoad();
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
</head>
<body></body>
</html>