Skip to content

Commit d973fd1

Browse files
committed
posting a test video
1 parent d928945 commit d973fd1

File tree

2 files changed

+178
-0
lines changed

2 files changed

+178
-0
lines changed

examples/video/pb-ve-test.html

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
---
2+
layout: video_sample
3+
title: Prebid Video | Instream Example with JW Player (Hosted)
4+
description: An example of an instream pre-roll ad using Prebid.js and JW Player (Hosted).
5+
videoType: pb-is-jw02
6+
isVideo: true
7+
sidebarType: 4
8+
---
9+
10+
11+
12+
<div class="container">
13+
<div class="row">
14+
<h1>{{ page.title }}</h1>
15+
<p>{{page.description }}</p>
16+
17+
<!--video warning-->
18+
<div markdown="span" class="pb-alert pb-alert-important" role="alert">
19+
<i class="fa fa-exclamation-circle"></i>
20+
<p style="color:#85720f"><b>Important:</b>
21+
This example uses a test version of Prebid.js hosted on our CDN that is not recommended for production use. It includes all available adapters. Production implementations should build from source or customize the build using the Download page to make sure only the necessary bidder adapters are included.</p>
22+
</div>
23+
24+
<!--video placeholder | this should be formatted per the needs of each player-->
25+
<div id="playerContainerJW" style='width:640px; height:480px; border:1px solid black;'></div>
26+
27+
<!--video code fencing-->
28+
29+
<!--header code example-->
30+
<div markdown="span" class="pb-alert pb-alert-warning" role="alert">
31+
<i class="fa fa-exclamation-circle"></i>
32+
<p style="color:#a94443"><b>Warning:</b>
33+
Do not forget to exchange the placementId in the code examples with your own placementId!</p>
34+
</div>
35+
36+
<div>
37+
<h4>Place this code in the page header.</h4>
38+
<pre class="pb-code-hl">
39+
<!--put javascript code here-->
40+
&lt;script async src="//acdn.adnxs.com/prebid/not-for-prod/1/prebid.js"&gt;&lt;/script&gt;
41+
&lt;script type="text/javascript" src="http://ssl.p.jwpcdn.com/player/v/7.2.4/jwplayer.js"&gt;&lt;/script&gt;
42+
&lt;script type="text/javascript"&gt;
43+
jwplayer.key = "YEUwUA9wRFeDcydr"; //Test Key - replace this with your own valid JWPlayer license key<br>
44+
&lt;/script&gt;
45+
&lt;script&gt;
46+
var pbjs = pbjs || {};
47+
pbjs.que = pbjs.que || [];
48+
49+
// define invokeVideoPlayer in advance in case we get the bids back from prebid before the entire page loads<br>
50+
var tempTag = false;
51+
var invokeVideoPlayer = function(url) {
52+
tempTag = url;
53+
}
54+
55+
var videoAdUnit = {
56+
code: 'video1',
57+
mediaTypes: {
58+
video: {
59+
playerSize: [640, 480],
60+
context: 'instream'
61+
}
62+
},
63+
bids: [{
64+
bidder: 'appnexus',
65+
params: {
66+
placementId: 13232361, // Add your own placement id here<br>
67+
video: {
68+
skipppable: true,
69+
playback_method: ['auto_play_sound_off']
70+
}
71+
}
72+
}]
73+
};
74+
75+
pbjs.que.push(function() {
76+
pbjs.addAdUnits(videoAdUnit); // add your ad units to the bid request<br>
77+
pbjs.setConfig({
78+
debug: true,
79+
cache: {
80+
url: 'https://prebid.adnxs.com/pbc/v1/cache'
81+
}
82+
});
83+
84+
pbjs.requestBids({
85+
bidsBackHandler: function(bids) {
86+
var videoUrl = pbjs.adServers.dfp.buildVideoUrl({
87+
adUnit: videoAdUnit,
88+
params: {
89+
iu: '/19968336/prebid_cache_video_adunit',
90+
cust_params: {
91+
section: 'blog',
92+
anotherKey: 'anotherValue'
93+
},
94+
output: 'vast'
95+
}
96+
});
97+
invokeVideoPlayer(videoUrl);
98+
}
99+
});
100+
});
101+
102+
&lt;/script&gt;
103+
</pre>
104+
105+
</div>
106+
107+
<!--body code example-->
108+
<div>
109+
<h4>Place this code in the page body.</h4>
110+
<pre class="pb-code-hl">
111+
<!--put body html and javascript here-->
112+
&lt;!--player div--&gt;
113+
&lt;div id="playerContainerJW" style='width:640px; height:480px; border:1px solid black;'&gt;&lt;/div&gt;
114+
&lt;script&gt;
115+
var jwPlayerInstance = jwplayer("playerContainerJW");
116+
117+
invokeVideoPlayer = function(url) {
118+
jwPlayerInstance.setup({
119+
"file": "http://video-demo.appnexus.com/pbjs/JWPlayerDemo/AppNexus_Summit_Video_HighRes.mp4",
120+
"width": 640,
121+
"height": 480,
122+
"autostart": true,
123+
"mute": true,
124+
"advertising": {
125+
client: "vast",
126+
}
127+
});
128+
129+
jwPlayerInstance.on('beforePlay', function() {
130+
jwPlayerInstance.playAd(url);
131+
})
132+
}
133+
134+
if (tempTag) {
135+
invokeVideoPlayer(tempTag);
136+
tempTag = false;
137+
}
138+
139+
&lt;/script&gt;
140+
141+
142+
</pre>
143+
</div>
144+
145+
</div>
146+
</div>
147+
148+
<!--video player code-->
149+
<script>
150+
var jwPlayerInstance = jwplayer("playerContainerJW");
151+
152+
invokeVideoPlayer = function(url) {
153+
jwPlayerInstance.setup({
154+
"file": "http://localhost:8080/examples/video/instream/jwplayer/pb-ve-jwplayer-hosted.html",
155+
"width": 640,
156+
"height": 480,
157+
"autostart": true,
158+
"mute": true,
159+
"advertising": {
160+
client: "vast",
161+
}
162+
});
163+
164+
jwPlayerInstance.on('beforePlay', function() {
165+
jwPlayerInstance.playAd(url);
166+
})
167+
}
168+
169+
if (tempTag) {
170+
invokeVideoPlayer(tempTag);
171+
tempTag = false;
172+
}
173+
174+
</script>
175+
176+
177+
<script type="text/javascript" src="/assets/js/video/pb-code-highlight.js"></script>
178+
23.2 MB
Binary file not shown.

0 commit comments

Comments
 (0)