Skip to content

Commit

Permalink
Smartx Bid Adapter: enable pbjs log for bid request & outstream playe…
Browse files Browse the repository at this point in the history
…r config adjustment (#7701)

* Add smartclipBidAdapter

* smartxBidAdapter.js - removed unused variables, removed debug, added window before the outstream related functions

* - made outstream player configurable

* remove wrong named files

* camelcase

* fix

* Out-Stream render update to SmartPlay 5.2

* ESlint fix

* ESlint fix

* ESlint fix

* adjust tests, fixes

* ESlint

* adjusted desired bitrate examples

* added bid.meta.advertiserDomains support

* bug fix for numeric elementID outstream render

* fix renderer url

* support for floors module

* bugfixes to be openRTB 2.5 compliant

* update internal renderer usage

* remove unused outstream_function logic

* bugfix outstream options for default outstream renderer configuration

* [PREB-10] fix empty title not configurable

* add pbjs version

* testing with outstream 5.3.0

* pbjs version into content.ext

* made visibilityThreshold configurable

* adjust position of pbjs version

Co-authored-by: smartclip AdTechnology <adtech@smartclip.com>
Co-authored-by: Gino Cirlini <adtech@smartclip.tv>
  • Loading branch information
3 people authored Nov 12, 2021
1 parent 2e00b21 commit 1cdedca
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
18 changes: 17 additions & 1 deletion modules/smartxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,20 @@ export const spec = {
domain: domain,
publisher: {
id: publisherId
},
content: {
ext: {
prebid: {
name: 'pbjs',
version: '$prebid.version$'
}
}
}
},
device: device,
at: at,
cur: cur
cur: cur,
ext: {}
};

const userExt = {};
Expand Down Expand Up @@ -194,6 +203,8 @@ export const spec = {
};
}

// requestPayload.user.ext.ver = pbjs.version;

// Targeting
if (getBidIdParameter('data', bid.params.user)) {
var targetingarr = [];
Expand Down Expand Up @@ -336,6 +347,7 @@ function createOutstreamConfig(bid) {
let confTitle = getBidIdParameter('title', bid.renderer.config.outstream_options);
let confSkipOffset = getBidIdParameter('skipOffset', bid.renderer.config.outstream_options);
let confDesiredBitrate = getBidIdParameter('desiredBitrate', bid.renderer.config.outstream_options);
let confVisibilityThreshold = getBidIdParameter('visibilityThreshold', bid.renderer.config.outstream_options);
let elementId = getBidIdParameter('slot', bid.renderer.config.outstream_options) || bid.adUnitCode;

logMessage('[SMARTX][renderer] Handle SmartX outstream renderer');
Expand Down Expand Up @@ -384,6 +396,10 @@ function createOutstreamConfig(bid) {
smartPlayObj.desiredBitrate = confDesiredBitrate;
}

if (confVisibilityThreshold) {
smartPlayObj.visibilityThreshold = confVisibilityThreshold;
}

smartPlayObj.adResponse = bid.vastContent;

const divID = '[id="' + elementId + '"]';
Expand Down
9 changes: 9 additions & 0 deletions test/spec/modules/smartxBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ describe('The smartx adapter', function () {
domain: '',
publisher: {
id: '__name__'
},
content: {
ext: {
prebid: {
name: 'pbjs',
version: '$prebid.version$'
}
}
}
});
});
Expand Down Expand Up @@ -525,6 +533,7 @@ describe('The smartx adapter', function () {
bidderRequestObj.bidRequest.bids[0].params.outstream_options.title = 'abc';
bidderRequestObj.bidRequest.bids[0].params.outstream_options.skipOffset = 2;
bidderRequestObj.bidRequest.bids[0].params.outstream_options.desiredBitrate = 123;
bidderRequestObj.bidRequest.bids[0].params.outstream_options.visibilityThreshold = 30;

responses[0].renderer.render(responses[0]);

Expand Down

0 comments on commit 1cdedca

Please sign in to comment.