Skip to content

Commit

Permalink
update conversant bid adapter to use video playerSize instead of size…
Browse files Browse the repository at this point in the history
…s to determine the video player size (#3372)
  • Loading branch information
sohlhausen authored and bretg committed Dec 13, 2018
1 parent 4c1f690 commit ba49c0d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
6 changes: 5 additions & 1 deletion modules/conversantBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const spec = {
siteId = utils.getBidIdParameter('site_id', bid.params);
requestId = bid.auctionId;

const format = convertSizes(bid.sizes);
let format = convertSizes(bid.sizes);

const imp = {
id: bid.bidId,
Expand All @@ -75,6 +75,10 @@ export const spec = {
copyOptProperty(bid.params, 'tag_id', imp, 'tagid');

if (isVideoRequest(bid)) {
if (bid.mediaTypes.video.playerSize) {
format = convertSizes(bid.mediaTypes.video.playerSize);
}

const video = {
w: format[0].w,
h: format[0].h
Expand Down
5 changes: 3 additions & 2 deletions modules/conversantBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ var adUnits = [
sizes: [640, 480],
mediaTypes: {
video: {
context: 'instream'
context: 'instream',
playerSize: [640, 480]
}
},
bids: [{
Expand All @@ -38,4 +39,4 @@ var adUnits = [
}
}]
}];
```
```
11 changes: 6 additions & 5 deletions test/spec/modules/conversantBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ describe('Conversant adapter tests', function() {
},
mediaTypes: {
video: {
context: 'instream'
context: 'instream',
playerSize: [632, 499],
}
},
placementCode: 'pcode003',
Expand Down Expand Up @@ -193,8 +194,8 @@ describe('Conversant adapter tests', function() {
expect(payload.imp[3]).to.not.have.property('tagid');
expect(payload.imp[3]).to.have.property('video');
expect(payload.imp[3].video).to.not.have.property('pos');
expect(payload.imp[3].video).to.have.property('w', 640);
expect(payload.imp[3].video).to.have.property('h', 480);
expect(payload.imp[3].video).to.have.property('w', 632);
expect(payload.imp[3].video).to.have.property('h', 499);
expect(payload.imp[3].video).to.have.property('mimes');
expect(payload.imp[3].video.mimes).to.deep.equal(['video/mp4', 'video/x-flv']);
expect(payload.imp[3].video).to.have.property('protocols');
Expand Down Expand Up @@ -254,8 +255,8 @@ describe('Conversant adapter tests', function() {
expect(bid).to.have.property('currency', 'USD');
expect(bid).to.have.property('cpm', 3.99);
expect(bid).to.have.property('creativeId', '1003');
expect(bid).to.have.property('width', 640);
expect(bid).to.have.property('height', 480);
expect(bid).to.have.property('width', 632);
expect(bid).to.have.property('height', 499);
expect(bid).to.have.property('vastUrl', 'markup003');
expect(bid).to.have.property('mediaType', 'video');
expect(bid).to.have.property('ttl', 300);
Expand Down

0 comments on commit ba49c0d

Please sign in to comment.