From ba49c0d56f1767ab2220ff3d14824ed39adbbe34 Mon Sep 17 00:00:00 2001 From: Suzanne Ohlhausen Date: Thu, 13 Dec 2018 13:23:21 -0500 Subject: [PATCH] update conversant bid adapter to use video playerSize instead of sizes to determine the video player size (#3372) --- modules/conversantBidAdapter.js | 6 +++++- modules/conversantBidAdapter.md | 5 +++-- test/spec/modules/conversantBidAdapter_spec.js | 11 ++++++----- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/modules/conversantBidAdapter.js b/modules/conversantBidAdapter.js index aae892f4eed..b3d944a99e4 100644 --- a/modules/conversantBidAdapter.js +++ b/modules/conversantBidAdapter.js @@ -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, @@ -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 diff --git a/modules/conversantBidAdapter.md b/modules/conversantBidAdapter.md index 1afdad6d544..2b1e3ce8d55 100644 --- a/modules/conversantBidAdapter.md +++ b/modules/conversantBidAdapter.md @@ -25,7 +25,8 @@ var adUnits = [ sizes: [640, 480], mediaTypes: { video: { - context: 'instream' + context: 'instream', + playerSize: [640, 480] } }, bids: [{ @@ -38,4 +39,4 @@ var adUnits = [ } }] }]; -``` \ No newline at end of file +``` diff --git a/test/spec/modules/conversantBidAdapter_spec.js b/test/spec/modules/conversantBidAdapter_spec.js index 91b3ed6892b..be173279f2d 100644 --- a/test/spec/modules/conversantBidAdapter_spec.js +++ b/test/spec/modules/conversantBidAdapter_spec.js @@ -60,7 +60,8 @@ describe('Conversant adapter tests', function() { }, mediaTypes: { video: { - context: 'instream' + context: 'instream', + playerSize: [632, 499], } }, placementCode: 'pcode003', @@ -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'); @@ -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);