forked from prebid/prebid.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpbs-vjs.html
169 lines (137 loc) · 6.69 KB
/
pbs-vjs.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>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="google-site-verification" content="_SMhyxJ4MnU9eTUQQNMUwU5W18T5tjNF7A6mumIci-A" />
<meta name="keywords" content="Header Bidding, Advanced Bidding, Header Bid, Pre-bid">
<meta name="description" content="{{page.description}}" />
<link rel="shortcut icon" type="image/png" href="/favicon.png" />
{% if page.head_title %}
<title>{{page.head_title}}</title>
{% else %}
<title>{{page.title}} for Header Bidding</title>
{% endif %}
<!-- OneTrust Cookies Consent Notice start -->
<script src="https://cdn.cookielaw.org/consent/53783db5-1614-43d4-bb1a-148e68e8c87b.js" type="text/javascript" charset="UTF-8"></script>
<script type="text/javascript">
function OptanonWrapper() { }
</script>
<!-- OneTrust Cookies Consent Notice end -->
<!--<link href="{{site.baseurl}}/assets/css/bootstrap.min.css" rel="stylesheet">-->
<!-- Latest compiled and minified Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link href="{{site.baseurl}}/assets/css/docs.min.css" rel="stylesheet">
<link rel="stylesheet" href="/assets/css/prism.css">
<link href="{{site.baseurl}}/assets/css/style.css" rel="stylesheet">
<!-- Favicons -->
<link href="{{site.baseurl}}/assets/images/favicon.png" rel="icon">
<link href="{{site.baseurl}}/assets/images/apple-touch-icon.png" rel="apple-touch-icon">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Montserrat:300,400,500,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,300i,400,400i,700,700i>
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans+Condensed" />
<link href="https://fonts.googleapis.com/css?family=Dosis" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed" rel="stylesheet">
<style>
#content {
background:{{site.header.color1}};
background:linear-gradient(135deg, {{site.header.color1}}, {{site.header.color2}});
}
</style>
<script src="{{site.baseurl}}/assets/js/prism.js"></script>
<script src="{{site.baseurl}}/assets/js/jquery.min.js"></script>
<script src="{{site.baseurl}}/assets/js/bootstrap.js"></script>
<script src="{{site.baseurl}}/assets/js/bootbox.min.js"></script>
<script src="{{site.baseurl}}/assets/js/docs.min.js"></script>
<script src="{{site.baseurl}}/assets/js/easing.min.js"></script>
<script src="{{site.baseurl}}/assets/js/main.js"></script>
<script type="text/javascript" src="{{site.baseurl}}/assets/js/pbjs_home.js"></script>
<!--production version of prebid.js-->
<script async src="//acdn.adnxs.com/prebid/not-for-prod/1/prebid.js"></script>
<!--pbjs and player code -->
<!-- LOAD OOYALA PLUGINS
<!-- videojs -->
<!-- use recent version of videojs to ensure proper functioning with the iOS devices -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/video.js/6.4.0/video-js.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/video.js/6.4.0/video.js"></script>
<!-- videojs-vast-vpaid -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/videojs-vast-vpaid/2.0.2/videojs.vast.vpaid.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-vast-vpaid/2.0.2/videojs_5.vast.vpaid.min.js"></script>
<script>
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
/* PRE-DEFINE `invokeVideoPlayer`
Because we have no way of knowing when all the bids will be
returned from Prebid we can't be sure that the browser will
reach the point where `invokeVideoPlayer` is defined before
`bidsBackHandler` fires and tries to call it.
To prevent an "`invokeVideoPlayer` not defined" error, we
pre-define it before we make the call to Prebid, and redefine
it later on with the code to create the player and play the
ad.
In this first version, it simply stores the winning VAST to
use later. */
var tempTag = false;
var invokeVideoPlayer = function(url) {
tempTag = url;
};
/* Prebid video ad unit */
var videoAdUnit = {
code: 'video1',
mediaTypes: {
video: {
playerSize: [640, 480],
context: 'instream',
mimes: ['video/mp4'],
protocols: [1, 2, 3, 4, 5, 6],
playbackmethod: [2]
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: 13232361, // Add your own placement id here.
video: {
skippable: true,
playback_method: ['auto_play_sound_off']
}
}
}]
};
pbjs.que.push(function() {
// configure prebid to use prebid cache and prebid server
// make sure to add your own accountId to your s2sConfig object
pbjs.setConfig({
cache: {
url: 'https://prebid.adnxs.com/pbc/v1/cache'
},
debug: true,
s2sConfig: {
endpoint: 'http://prebid.adnxs.com/pbs/v1/openrtb2/auction',
enabled: true,
accountId: 'c9d412ee-3cc6-4b66-9326-9f49d528f13e', // replace this with your account id
bidders: ['appnexus']
}
});
pbjs.addAdUnits(videoAdUnit); // add your ad units to the bid request
pbjs.requestBids({
bidsBackHandler: function(bids) {
var videoUrl = pbjs.adServers.dfp.buildVideoUrl({
adUnit: videoAdUnit,
params: {
iu: '/19968336/prebid_cache_video_adunit',
cust_params: {
section: 'blog',
anotherKey: 'anotherValue'
},
output: 'vast'
}
});
invokeVideoPlayer(videoUrl);
}
});
});
</script>
</head>
<body>