diff --git a/_includes/loadScript.html b/_includes/loadScript.html new file mode 100644 index 0000000000..fac994fb38 --- /dev/null +++ b/_includes/loadScript.html @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/_includes/video/mock-video-bid.html b/_includes/video/mock-video-bid.html new file mode 100644 index 0000000000..ec49e19765 --- /dev/null +++ b/_includes/video/mock-video-bid.html @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/_includes/video/pb-is-jw01.html b/_includes/video/pb-is-jw01.html index a96915d12d..eeab1a3ddc 100644 --- a/_includes/video/pb-is-jw01.html +++ b/_includes/video/pb-is-jw01.html @@ -3,68 +3,66 @@ {% include head--common.html %} {% include prebidjs-non-prod.html %} + {% include loadScript.html %} + {% include video/mock-video-bid.html %} + diff --git a/_includes/video/pb-is-jw02.html b/_includes/video/pb-is-jw02.html index 8162a69928..9b8dba6793 100644 --- a/_includes/video/pb-is-jw02.html +++ b/_includes/video/pb-is-jw02.html @@ -2,73 +2,67 @@ {% include head--common.html %} {% include prebidjs-non-prod.html %} + {% include loadScript.html %} + {% include video/mock-video-bid.html %} - - - + diff --git a/_includes/video/pb-is-vjs.html b/_includes/video/pb-is-vjs.html index bdedf89b65..ef411b5bfe 100644 --- a/_includes/video/pb-is-vjs.html +++ b/_includes/video/pb-is-vjs.html @@ -2,6 +2,8 @@ {% include head--common.html %} {% include prebidjs-non-prod.html %} + {% include loadScript.html %} + {% include video/mock-video-bid.html %} @@ -15,78 +17,67 @@ rel="stylesheet" /> - - - - - + diff --git a/examples/video/instream/jwplayer/pb-ve-jwplayer-hosted.html b/examples/video/instream/jwplayer/pb-ve-jwplayer-hosted.html index 67ab3e318d..261a78d8ca 100644 --- a/examples/video/instream/jwplayer/pb-ve-jwplayer-hosted.html +++ b/examples/video/instream/jwplayer/pb-ve-jwplayer-hosted.html @@ -57,8 +57,8 @@

Place this code in the page header.

// define invokeVideoPlayer in advance in case we get the bids back from prebid before the entire page loads
var tempTag = false; - var invokeVideoPlayer = function(url) { - tempTag = url; + var invokeVideoPlayer = function(vastXml) { + tempTag = vastXml; } var videoAdUnit = { @@ -86,24 +86,18 @@

Place this code in the page header.

pbjs.setConfig({ debug: true, cache: { - url: 'https://prebid.example.com/pbc/v1/cache' + useLocal: true } }); pbjs.requestBids({ bidsBackHandler: function(bids) { - var videoUrl = pbjs.adServers.dfp.buildVideoUrl({ + pbjs.adServers.gam.getVastXml({ adUnit: videoAdUnit, params: { - iu: '/19968336/prebid_cache_video_adunit', - cust_params: { - section: 'blog', - anotherKey: 'anotherValue' - }, - output: 'vast' - } - }); - invokeVideoPlayer(videoUrl); + iu: '/41758329/localcache', + }, + }).then(vastXml => invokeVideoPlayer(vastXml)); } }); }); @@ -123,7 +117,7 @@

Place this code in the page body.

<script> var jwPlayerInstance = jwplayer("playerContainerJW"); - invokeVideoPlayer = function(url) { + invokeVideoPlayer = function(vastXml) { jwPlayerInstance.setup({ "file": "https://vjs.zencdn.net/v/oceans.mp4", "width": 640, @@ -132,12 +126,14 @@

Place this code in the page body.

"mute": false, "advertising": { client: "vast", + schedule: [ + { + vastxml: vastXml, + offset: 'pre' + } + ] } }); - - jwPlayerInstance.on('beforePlay', function() { - jwPlayerInstance.playAd(url); - }) } if (tempTag) { @@ -155,10 +151,10 @@

Place this code in the page body.

diff --git a/examples/video/instream/jwplayer/pb-ve-jwplayer-platform.html b/examples/video/instream/jwplayer/pb-ve-jwplayer-platform.html index 64f06968ec..fe8c1035af 100644 --- a/examples/video/instream/jwplayer/pb-ve-jwplayer-platform.html +++ b/examples/video/instream/jwplayer/pb-ve-jwplayer-platform.html @@ -7,13 +7,6 @@ sidebarType: 4 --- - -
@@ -57,8 +50,8 @@

Place this code in the page header.

// define invokeVideoPlayer in advance in case we get the bids back from prebid before the entire page loads
var tempTag = false; - var invokeVideoPlayer = function(url) { - tempTag = url; + var invokeVideoPlayer = function(vastXml) { + tempTag = vastXml; } var videoAdUnit = { @@ -88,26 +81,20 @@

Place this code in the page header.

pbjs.setConfig({ debug: true, cache: { - url: 'https://prebid.example.com/pbc/v1/cache' + useLocal: true } }); - 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); - } - }); + pbjs.requestBids({ + bidsBackHandler: function(bids) { + pbjs.adServers.gam.getVastXml({ + adUnit: videoAdUnit, + params: { + iu: '/41758329/localcache', + }, + }).then(vastXml => invokeVideoPlayer(vastXml)); + } + }); }); </script> @@ -157,7 +144,7 @@

Place this code in the page body.