From 7886b0bab4a3876bb5f7e46a781d538dd85c31b9 Mon Sep 17 00:00:00 2001 From: Sleiman Jneidi Date: Thu, 3 Jun 2021 18:14:47 +0100 Subject: [PATCH 1/4] qcAdpater, uses vidoe mediatypes to read properties --- modules/quantcastBidAdapter.js | 78 +++++++++++++------ test/spec/modules/quantcastBidAdapter_spec.js | 34 ++++---- 2 files changed, 76 insertions(+), 36 deletions(-) diff --git a/modules/quantcastBidAdapter.js b/modules/quantcastBidAdapter.js index 408f05d33cb..c5255ab42b1 100644 --- a/modules/quantcastBidAdapter.js +++ b/modules/quantcastBidAdapter.js @@ -25,29 +25,61 @@ export const storage = getStorageManager(QUANTCAST_VENDOR_ID, BIDDER_CODE); function makeVideoImp(bid) { const video = {}; - if (bid.params.video) { - video['mimes'] = bid.params.video.mimes; - video['minduration'] = bid.params.video.minduration; - video['maxduration'] = bid.params.video.maxduration; - video['protocols'] = bid.params.video.protocols; - video['startdelay'] = bid.params.video.startdelay; - video['linearity'] = bid.params.video.linearity; - video['battr'] = bid.params.video.battr; - video['maxbitrate'] = bid.params.video.maxbitrate; - video['playbackmethod'] = bid.params.video.playbackmethod; - video['delivery'] = bid.params.video.delivery; - video['placement'] = bid.params.video.placement; - video['api'] = bid.params.video.api; - } - if (bid.mediaTypes.video.mimes) { - video['mimes'] = bid.mediaTypes.video.mimes; - } - if (utils.isArray(bid.mediaTypes.video.playerSize[0])) { - video['w'] = bid.mediaTypes.video.playerSize[0][0]; - video['h'] = bid.mediaTypes.video.playerSize[0][1]; - } else { - video['w'] = bid.mediaTypes.video.playerSize[0]; - video['h'] = bid.mediaTypes.video.playerSize[1]; + if (bid.mediaTypes && bid.mediaTypes.video) { + if (bid.mediaTypes.video.minduration) { + video['minduration'] = bid.mediaTypes.video.minduration; + } + + if (bid.mediaTypes.video.maxduration) { + video['maxduration'] = bid.mediaTypes.video.maxduration; + } + + if (bid.mediaTypes.video.protocols) { + video['protocols'] = bid.mediaTypes.video.protocols; + } + + if (bid.mediaTypes.video.startdelay) { + video['startdelay'] = bid.mediaTypes.video.startdelay; + } + + if (bid.mediaTypes.video.linearity) { + video['linearity'] = bid.mediaTypes.video.linearity; + } + + if (bid.mediaTypes.video.battr) { + video['battr'] = bid.mediaTypes.video.battr; + } + + if (bid.mediaTypes.video.maxbitrate) { + video['maxbitrate'] = bid.mediaTypes.video.maxbitrate; + } + + if (bid.mediaTypes.video.playbackmethod) { + video['playbackmethod'] = bid.mediaTypes.video.playbackmethod; + } + + if (bid.mediaTypes.video.delivery) { + video['delivery'] = bid.mediaTypes.video.delivery; + } + + if (bid.mediaTypes.video.placement) { + video['placement'] = bid.mediaTypes.video.placement; + } + + if (bid.mediaTypes.video.api) { + video['api'] = bid.mediaTypes.video.api; + } + + if (bid.mediaTypes.video.mimes) { + video['mimes'] = bid.mediaTypes.video.mimes; + } + if (utils.isArray(bid.mediaTypes.video.playerSize[0])) { + video['w'] = bid.mediaTypes.video.playerSize[0][0]; + video['h'] = bid.mediaTypes.video.playerSize[0][1]; + } else { + video['w'] = bid.mediaTypes.video.playerSize[0]; + video['h'] = bid.mediaTypes.video.playerSize[1]; + } } return { video: video, diff --git a/test/spec/modules/quantcastBidAdapter_spec.js b/test/spec/modules/quantcastBidAdapter_spec.js index 584f4dcbaf4..77caac09c3e 100644 --- a/test/spec/modules/quantcastBidAdapter_spec.js +++ b/test/spec/modules/quantcastBidAdapter_spec.js @@ -163,18 +163,22 @@ describe('Quantcast adapter', function () { it('sends video bid requests containing all the required parameters', function () { setupVideoBidRequest({ - mimes: ['video/mp4'], // required - minduration: 3, // optional - maxduration: 5, // optional - protocols: [3], // optional - startdelay: 1, // optional - linearity: 1, // optinal - battr: [1, 2], // optional - maxbitrate: 10, // optional - playbackmethod: [1], // optional - delivery: [1], // optional - placement: 1, // optional - api: [2, 3] // optional + mediaTypes: { + video: { + mimes: ['video/mp4'], // required + minduration: 3, // optional + maxduration: 5, // optional + protocols: [3], // optional + startdelay: 1, // optional + linearity: 1, // optinal + battr: [1, 2], // optional + maxbitrate: 10, // optional + playbackmethod: [1], // optional + delivery: [1], // optional + placement: 1, // optional + api: [2, 3] // optional + } + } }); const requests = qcSpec.buildRequests([bidRequest], bidderRequest); @@ -221,7 +225,11 @@ describe('Quantcast adapter', function () { it('overrides video parameters with parameters from adunit', function() { setupVideoBidRequest({ - mimes: ['video/mp4'] + mediaTypes: { + video: { + mimes: ['video/mp4'] + } + } }); bidRequest.mediaTypes.video.mimes = ['video/webm']; From ae51e23bc6820e98403d62404bdfc9796b98618d Mon Sep 17 00:00:00 2001 From: Sleiman Jneidi Date: Fri, 4 Jun 2021 16:40:04 +0100 Subject: [PATCH 2/4] fix test --- modules/quantcastBidAdapter.js | 115 +++++++++++------- test/spec/modules/quantcastBidAdapter_spec.js | 106 ++++++++++++---- 2 files changed, 154 insertions(+), 67 deletions(-) diff --git a/modules/quantcastBidAdapter.js b/modules/quantcastBidAdapter.js index c5255ab42b1..a1dd60f634e 100644 --- a/modules/quantcastBidAdapter.js +++ b/modules/quantcastBidAdapter.js @@ -25,62 +25,89 @@ export const storage = getStorageManager(QUANTCAST_VENDOR_ID, BIDDER_CODE); function makeVideoImp(bid) { const video = {}; - if (bid.mediaTypes && bid.mediaTypes.video) { - if (bid.mediaTypes.video.minduration) { - video['minduration'] = bid.mediaTypes.video.minduration; - } - if (bid.mediaTypes.video.maxduration) { - video['maxduration'] = bid.mediaTypes.video.maxduration; - } + if (bid.params.video) { + video['mimes'] = bid.params.video.mimes; + } - if (bid.mediaTypes.video.protocols) { - video['protocols'] = bid.mediaTypes.video.protocols; - } + if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.minduration) { + video['minduration'] = bid.mediaTypes.video.minduration; + } else if (bid.params.video) { + video['minduration'] = bid.params.video.minduration; + } - if (bid.mediaTypes.video.startdelay) { - video['startdelay'] = bid.mediaTypes.video.startdelay; - } + if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.maxduration) { + video['maxduration'] = bid.mediaTypes.video.maxduration; + } else if (bid.params.video) { + video['maxduration'] = bid.params.video.maxduration; + } - if (bid.mediaTypes.video.linearity) { - video['linearity'] = bid.mediaTypes.video.linearity; - } + if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.protocols) { + video['protocols'] = bid.mediaTypes.video.protocols; + } else if (bid.params.video) { + video['protocols'] = bid.params.video.protocols; + } - if (bid.mediaTypes.video.battr) { - video['battr'] = bid.mediaTypes.video.battr; - } + if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.startdelay) { + video['startdelay'] = bid.mediaTypes.video.startdelay; + } else if (bid.params.video) { + video['startdelay'] = bid.params.video.startdelay; + } - if (bid.mediaTypes.video.maxbitrate) { - video['maxbitrate'] = bid.mediaTypes.video.maxbitrate; - } + if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.linearity) { + video['linearity'] = bid.mediaTypes.video.linearity; + } else if (bid.params.video) { + video['linearity'] = bid.params.video.linearity; + } - if (bid.mediaTypes.video.playbackmethod) { - video['playbackmethod'] = bid.mediaTypes.video.playbackmethod; - } + if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.battr) { + video['battr'] = bid.mediaTypes.video.battr; + } else if (bid.params.video) { + video['battr'] = bid.params.video.battr; + } - if (bid.mediaTypes.video.delivery) { - video['delivery'] = bid.mediaTypes.video.delivery; - } + if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.maxbitrate) { + video['maxbitrate'] = bid.mediaTypes.video.maxbitrate; + } else if (bid.params.video) { + video['maxbitrate'] = bid.params.video.maxbitrate; + } - if (bid.mediaTypes.video.placement) { - video['placement'] = bid.mediaTypes.video.placement; - } + if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.playbackmethod) { + video['playbackmethod'] = bid.mediaTypes.video.playbackmethod; + } else if (bid.params.video) { + video['playbackmethod'] = bid.params.video.playbackmethod; + } - if (bid.mediaTypes.video.api) { - video['api'] = bid.mediaTypes.video.api; - } + if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.delivery) { + video['delivery'] = bid.mediaTypes.video.delivery; + } else if (bid.params.video) { + video['delivery'] = bid.params.video.delivery; + } - if (bid.mediaTypes.video.mimes) { - video['mimes'] = bid.mediaTypes.video.mimes; - } - if (utils.isArray(bid.mediaTypes.video.playerSize[0])) { - video['w'] = bid.mediaTypes.video.playerSize[0][0]; - video['h'] = bid.mediaTypes.video.playerSize[0][1]; - } else { - video['w'] = bid.mediaTypes.video.playerSize[0]; - video['h'] = bid.mediaTypes.video.playerSize[1]; - } + if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.placement) { + video['placement'] = bid.mediaTypes.video.placement; + } else if (bid.params.video) { + video['placement'] = bid.params.video.placement; } + + if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.api) { + video['api'] = bid.mediaTypes.video.api; + } else if (bid.params.video) { + video['api'] = bid.params.video.api; + } + + if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.mimes) { + video['mimes'] = bid.mediaTypes.video.mimes; + } + + if (utils.isArray(bid.mediaTypes.video.playerSize[0])) { + video['w'] = bid.mediaTypes.video.playerSize[0][0]; + video['h'] = bid.mediaTypes.video.playerSize[0][1]; + } else { + video['w'] = bid.mediaTypes.video.playerSize[0]; + video['h'] = bid.mediaTypes.video.playerSize[1]; + } + return { video: video, placementCode: bid.placementCode, diff --git a/test/spec/modules/quantcastBidAdapter_spec.js b/test/spec/modules/quantcastBidAdapter_spec.js index 77caac09c3e..0b6cd1e7a77 100644 --- a/test/spec/modules/quantcastBidAdapter_spec.js +++ b/test/spec/modules/quantcastBidAdapter_spec.js @@ -47,19 +47,20 @@ describe('Quantcast adapter', function () { storage.setCookie('__qca', '', 'Thu, 01 Jan 1970 00:00:00 GMT'); }); - function setupVideoBidRequest(videoParams) { + function setupVideoBidRequest(videoParams, mediaTypesParams) { bidRequest.params = { publisherId: 'test-publisher', // REQUIRED - Publisher ID provided by Quantcast // Video object as specified in OpenRTB 2.5 video: videoParams }; bidRequest['mediaTypes'] = { - video: { - context: 'instream', - playerSize: [600, 300] - } + video: mediaTypesParams } }; + /* + context: 'instream', + playerSize: [600, 300] + */ describe('inherited functions', function () { it('exists and is a function', function () { @@ -163,22 +164,21 @@ describe('Quantcast adapter', function () { it('sends video bid requests containing all the required parameters', function () { setupVideoBidRequest({ - mediaTypes: { - video: { - mimes: ['video/mp4'], // required - minduration: 3, // optional - maxduration: 5, // optional - protocols: [3], // optional - startdelay: 1, // optional - linearity: 1, // optinal - battr: [1, 2], // optional - maxbitrate: 10, // optional - playbackmethod: [1], // optional - delivery: [1], // optional - placement: 1, // optional - api: [2, 3] // optional - } - } + mimes: ['video/mp4'], // required + minduration: 3, // optional + maxduration: 5, // optional + protocols: [3], // optional + startdelay: 1, // optional + linearity: 1, // optinal + battr: [1, 2], // optional + maxbitrate: 10, // optional + playbackmethod: [1], // optional + delivery: [1], // optional + placement: 1, // optional + api: [2, 3] // optional + }, { + context: 'instream', + playerSize: [600, 300] }); const requests = qcSpec.buildRequests([bidRequest], bidderRequest); @@ -223,6 +223,66 @@ describe('Quantcast adapter', function () { expect(requests[0].data).to.equal(JSON.stringify(expectedVideoBidRequest)); }); + it('sends video bid requests containing all the required parameters from mediaTypes', function() { + setupVideoBidRequest(null, { + mimes: ['video/mp4'], // required + minduration: 3, // optional + maxduration: 5, // optional + protocols: [3], // optional + startdelay: 1, // optional + linearity: 1, // optinal + battr: [1, 2], // optional + maxbitrate: 10, // optional + playbackmethod: [1], // optional + delivery: [1], // optional + placement: 1, // optional + api: [2, 3], // optional + context: 'instream', + playerSize: [600, 300] + }); + + const requests = qcSpec.buildRequests([bidRequest], bidderRequest); + const expectedVideoBidRequest = { + publisherId: QUANTCAST_TEST_PUBLISHER, + requestId: '2f7b179d443f14', + imp: [ + { + video: { + minduration: 3, + maxduration: 5, + protocols: [3], + startdelay: 1, + linearity: 1, + battr: [1, 2], + maxbitrate: 10, + playbackmethod: [1], + delivery: [1], + placement: 1, + api: [2, 3], + mimes: ['video/mp4'], + w: 600, + h: 300 + }, + placementCode: 'div-gpt-ad-1438287399331-0', + bidFloor: 1e-10 + } + ], + site: { + page: 'http://example.com/hello.html', + referrer: 'http://example.com/hello.html', + domain: 'example.com' + }, + bidId: '2f7b179d443f14', + gdprSignal: 0, + uspSignal: 0, + coppa: 0, + prebidJsVersion: '$prebid.version$', + fpa: '' + }; + + expect(requests[0].data).to.equal(JSON.stringify(expectedVideoBidRequest)); + }); + it('overrides video parameters with parameters from adunit', function() { setupVideoBidRequest({ mediaTypes: { @@ -230,7 +290,7 @@ describe('Quantcast adapter', function () { mimes: ['video/mp4'] } } - }); + }, {}); bidRequest.mediaTypes.video.mimes = ['video/webm']; const requests = qcSpec.buildRequests([bidRequest], bidderRequest); @@ -265,7 +325,7 @@ describe('Quantcast adapter', function () { }); it('sends video bid request when no video parameters are given', function () { - setupVideoBidRequest(null); + setupVideoBidRequest(null, null); const requests = qcSpec.buildRequests([bidRequest], bidderRequest); const expectedVideoBidRequest = { From 1bd9b2c093245e647eb6a0d43a3cdd97f69b5abf Mon Sep 17 00:00:00 2001 From: Sleiman Jneidi Date: Tue, 8 Jun 2021 10:47:27 +0100 Subject: [PATCH 3/4] address comments --- modules/quantcastBidAdapter.js | 93 +++---------------- test/spec/modules/quantcastBidAdapter_spec.js | 31 +++---- 2 files changed, 27 insertions(+), 97 deletions(-) diff --git a/modules/quantcastBidAdapter.js b/modules/quantcastBidAdapter.js index a1dd60f634e..1eddb9c231a 100644 --- a/modules/quantcastBidAdapter.js +++ b/modules/quantcastBidAdapter.js @@ -11,6 +11,7 @@ const DEFAULT_BID_FLOOR = 0.0000000001; const QUANTCAST_VENDOR_ID = '11'; // Check other required purposes on server const PURPOSE_DATA_COLLECT = '1'; +const VIDEO_PROPS_TO_REMOVE = ['context', 'playerSize']; export const QUANTCAST_DOMAIN = 'qcx.quantserve.com'; export const QUANTCAST_TEST_DOMAIN = 's2s-canary.quantserve.com'; @@ -24,88 +25,18 @@ export const QUANTCAST_FPA = '__qca'; export const storage = getStorageManager(QUANTCAST_VENDOR_ID, BIDDER_CODE); function makeVideoImp(bid) { - const video = {}; + const videoInMediaType = utils.deepAccess(bid, 'mediaTypes.video') || {}; + const videoInParams = utils.deepAccess(bid, 'params.video') || {}; + const video = Object.assign({}, videoInParams, videoInMediaType); - if (bid.params.video) { - video['mimes'] = bid.params.video.mimes; + if (video.playerSize) { + video.w = video.playerSize[0]; + video.h = video.playerSize[1]; } - - if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.minduration) { - video['minduration'] = bid.mediaTypes.video.minduration; - } else if (bid.params.video) { - video['minduration'] = bid.params.video.minduration; - } - - if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.maxduration) { - video['maxduration'] = bid.mediaTypes.video.maxduration; - } else if (bid.params.video) { - video['maxduration'] = bid.params.video.maxduration; - } - - if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.protocols) { - video['protocols'] = bid.mediaTypes.video.protocols; - } else if (bid.params.video) { - video['protocols'] = bid.params.video.protocols; - } - - if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.startdelay) { - video['startdelay'] = bid.mediaTypes.video.startdelay; - } else if (bid.params.video) { - video['startdelay'] = bid.params.video.startdelay; - } - - if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.linearity) { - video['linearity'] = bid.mediaTypes.video.linearity; - } else if (bid.params.video) { - video['linearity'] = bid.params.video.linearity; - } - - if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.battr) { - video['battr'] = bid.mediaTypes.video.battr; - } else if (bid.params.video) { - video['battr'] = bid.params.video.battr; - } - - if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.maxbitrate) { - video['maxbitrate'] = bid.mediaTypes.video.maxbitrate; - } else if (bid.params.video) { - video['maxbitrate'] = bid.params.video.maxbitrate; - } - - if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.playbackmethod) { - video['playbackmethod'] = bid.mediaTypes.video.playbackmethod; - } else if (bid.params.video) { - video['playbackmethod'] = bid.params.video.playbackmethod; - } - - if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.delivery) { - video['delivery'] = bid.mediaTypes.video.delivery; - } else if (bid.params.video) { - video['delivery'] = bid.params.video.delivery; - } - - if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.placement) { - video['placement'] = bid.mediaTypes.video.placement; - } else if (bid.params.video) { - video['placement'] = bid.params.video.placement; - } - - if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.api) { - video['api'] = bid.mediaTypes.video.api; - } else if (bid.params.video) { - video['api'] = bid.params.video.api; - } - - if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.mimes) { - video['mimes'] = bid.mediaTypes.video.mimes; - } - - if (utils.isArray(bid.mediaTypes.video.playerSize[0])) { - video['w'] = bid.mediaTypes.video.playerSize[0][0]; - video['h'] = bid.mediaTypes.video.playerSize[0][1]; - } else { - video['w'] = bid.mediaTypes.video.playerSize[0]; - video['h'] = bid.mediaTypes.video.playerSize[1]; + for (const prop of VIDEO_PROPS_TO_REMOVE) { + if (video.hasOwnProperty(prop)) { + delete video[prop]; + } } return { @@ -329,9 +260,9 @@ export const spec = { if (dealId !== undefined && dealId) { result['dealId'] = dealId; } - result.meta = {}; if (meta !== undefined && meta.advertiserDomains && utils.isArray(meta.advertiserDomains)) { + result.meta = {}; result.meta.advertiserDomains = meta.advertiserDomains; } diff --git a/test/spec/modules/quantcastBidAdapter_spec.js b/test/spec/modules/quantcastBidAdapter_spec.js index 0b6cd1e7a77..5e0d129581c 100644 --- a/test/spec/modules/quantcastBidAdapter_spec.js +++ b/test/spec/modules/quantcastBidAdapter_spec.js @@ -53,14 +53,12 @@ describe('Quantcast adapter', function () { // Video object as specified in OpenRTB 2.5 video: videoParams }; - bidRequest['mediaTypes'] = { - video: mediaTypesParams + if (mediaTypesParams) { + bidRequest['mediaTypes'] = { + video: mediaTypesParams + } } }; - /* - context: 'instream', - playerSize: [600, 300] - */ describe('inherited functions', function () { it('exists and is a function', function () { @@ -248,6 +246,7 @@ describe('Quantcast adapter', function () { imp: [ { video: { + mimes: ['video/mp4'], minduration: 3, maxduration: 5, protocols: [3], @@ -259,7 +258,6 @@ describe('Quantcast adapter', function () { delivery: [1], placement: 1, api: [2, 3], - mimes: ['video/mp4'], w: 600, h: 300 }, @@ -285,12 +283,11 @@ describe('Quantcast adapter', function () { it('overrides video parameters with parameters from adunit', function() { setupVideoBidRequest({ - mediaTypes: { - video: { - mimes: ['video/mp4'] - } - } - }, {}); + mimes: ['video/mp4'] + }, { + context: 'instream', + playerSize: [600, 300] + }); bidRequest.mediaTypes.video.mimes = ['video/webm']; const requests = qcSpec.buildRequests([bidRequest], bidderRequest); @@ -325,7 +322,10 @@ describe('Quantcast adapter', function () { }); it('sends video bid request when no video parameters are given', function () { - setupVideoBidRequest(null, null); + setupVideoBidRequest(null, { + context: 'instream', + playerSize: [600, 300] + }); const requests = qcSpec.buildRequests([bidRequest], bidderRequest); const expectedVideoBidRequest = { @@ -834,8 +834,7 @@ describe('Quantcast adapter', function () { creativeId: undefined, ad: undefined, netRevenue: QUANTCAST_NET_REVENUE, - currency: 'USD', - meta: {} + currency: 'USD' }; const interpretedResponse = qcSpec.interpretResponse(videoResponse); From c8d8c174d02f13487834751ccd7984795d2b2602 Mon Sep 17 00:00:00 2001 From: Sleiman Jneidi Date: Tue, 8 Jun 2021 15:57:59 +0100 Subject: [PATCH 4/4] address comments --- modules/quantcastBidAdapter.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/modules/quantcastBidAdapter.js b/modules/quantcastBidAdapter.js index 1eddb9c231a..ecb5ad3176e 100644 --- a/modules/quantcastBidAdapter.js +++ b/modules/quantcastBidAdapter.js @@ -11,7 +11,6 @@ const DEFAULT_BID_FLOOR = 0.0000000001; const QUANTCAST_VENDOR_ID = '11'; // Check other required purposes on server const PURPOSE_DATA_COLLECT = '1'; -const VIDEO_PROPS_TO_REMOVE = ['context', 'playerSize']; export const QUANTCAST_DOMAIN = 'qcx.quantserve.com'; export const QUANTCAST_TEST_DOMAIN = 's2s-canary.quantserve.com'; @@ -33,14 +32,25 @@ function makeVideoImp(bid) { video.w = video.playerSize[0]; video.h = video.playerSize[1]; } - for (const prop of VIDEO_PROPS_TO_REMOVE) { - if (video.hasOwnProperty(prop)) { - delete video[prop]; - } + const videoCopy = { + mimes: video.mimes, + minduration: video.minduration, + maxduration: video.maxduration, + protocols: video.protocols, + startdelay: video.startdelay, + linearity: video.linearity, + battr: video.battr, + maxbitrate: video.maxbitrate, + playbackmethod: video.playbackmethod, + delivery: video.delivery, + placement: video.placement, + api: video.api, + w: video.w, + h: video.h } return { - video: video, + video: videoCopy, placementCode: bid.placementCode, bidFloor: bid.params.bidFloor || DEFAULT_BID_FLOOR };