Skip to content

Commit

Permalink
Pass the "vastUrl" property from the bid to the outstream renderer (#…
Browse files Browse the repository at this point in the history
…2918)

* Pass the "vastUrl" property from the bid to the outstream renderer

* Fix name of "bidRequest" parameter in "newRenderer" method

* Support using server-provided URL of outstream video renderer

* Support using publisher-provided URL of outstream video renderer

* Fix lint & mixed operators warning
  • Loading branch information
arikkfir authored and snapwich committed Aug 2, 2018
1 parent 47d3c3e commit c1a04f1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/gambidBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const spec = {
mediaType: 'video',
vastUrl: bid.ext.vast_url,
vastXml: bid.adm,
renderer: context === 'outstream' ? newRenderer(bidRequest, bid) : undefined
renderer: context === 'outstream' ? newRenderer(bidRequest.bidRequest, bid) : undefined
}));
}
});
Expand Down Expand Up @@ -174,9 +174,9 @@ export const spec = {
}
};

function newRenderer(adUnitCode, bid, rendererOptions = {}) {
function newRenderer(bidRequest, bid, rendererOptions = {}) {
const renderer = Renderer.install({
url: '//s.gamoshi.io/video/latest/renderer.js',
url: (bidRequest.params && bidRequest.params.rendererUrl) || (bid.ext && bid.ext.renderer_url) || '//s.gamoshi.io/video/latest/renderer.js',
config: rendererOptions,
loaded: false,
});
Expand All @@ -202,6 +202,7 @@ function renderOutstream(bid) {
window['GamoshiPlayer'].removeAd(unitId);
}, 300)
},
vastUrl: bid.vastUrl,
vastXml: bid.vastXml
});
});
Expand Down

0 comments on commit c1a04f1

Please sign in to comment.