Skip to content

Commit 1a5ad0c

Browse files
authored
FreeWheel SSP Adapter: add support for video.plcmt (#9978)
* FreeWheel add floor price * FreeWheel code update * FreeWheel-SSP-Adapter: Update to use Vast 4.2 by default * FreeWheel-SSP-Adapter add userIdAsEids support * Freewheel-SSP-Adapter add test for eids * Freewheel SSP Adapter: add prebid version in request * code cleanup * FreeWheel SSP Bid Adapter: support video context and placement * update test * FreeWheel SSP Bid Adapter: add GPP support * Freewheel SSP Bid Adapter: test update * FreeWheel SSP Adapter: update the default value for video placement and context * update test * FreeWheel SSP Adapter: add support for video.plcmt
1 parent f0e7488 commit 1a5ad0c

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

modules/freewheel-sspBidAdapter.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ export const spec = {
340340
var timeInMillis = new Date().getTime();
341341
var keyCode = hashcode(zone + '' + timeInMillis);
342342
var bidfloor = getBidFloor(currentBidRequest, config);
343+
var format = currentBidRequest.params.format;
343344

344345
var requestParams = {
345346
reqType: 'AdsSetup',
@@ -435,10 +436,17 @@ export const spec = {
435436

436437
// Add video context and placement in requestParams
437438
if (currentBidRequest.mediaTypes.video) {
438-
var videoContext = currentBidRequest.mediaTypes.video.context ? currentBidRequest.mediaTypes.video.context : 'instream';
439-
var videoPlacement = currentBidRequest.mediaTypes.video.placement ? currentBidRequest.mediaTypes.video.placement : 1;
439+
var videoContext = currentBidRequest.mediaTypes.video.context ? currentBidRequest.mediaTypes.video.context : '';
440+
var videoPlacement = currentBidRequest.mediaTypes.video.placement ? currentBidRequest.mediaTypes.video.placement : null;
441+
var videoPlcmt = currentBidRequest.mediaTypes.video.plcmt ? currentBidRequest.mediaTypes.video.plcmt : null;
442+
443+
if (format == 'inbanner') {
444+
videoPlacement = 2;
445+
videoContext = 'In-Banner';
446+
}
440447
requestParams.video_context = videoContext;
441448
requestParams.video_placement = videoPlacement;
449+
requestParams.video_plcmt = videoPlcmt;
442450
}
443451

444452
return {

test/spec/modules/freewheel-sspBidAdapter_spec.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,9 @@ describe('freewheelSSP BidAdapter Test', () => {
284284
it('should return context and placement with default values', () => {
285285
const request = spec.buildRequests(bidRequests);
286286
const payload = request[0].data;
287-
expect(payload.video_context).to.equal('instream'); ;
288-
expect(payload.video_placement).to.equal(1);
287+
expect(payload.video_context).to.equal(''); ;
288+
expect(payload.video_placement).to.equal(null);
289+
expect(payload.video_plcmt).to.equal(null);
289290
});
290291

291292
it('should add parameters to the tag', () => {
@@ -367,6 +368,7 @@ describe('freewheelSSP BidAdapter Test', () => {
367368
'video': {
368369
'context': 'outstream',
369370
'placement': 2,
371+
'plcmt': 3,
370372
'playerSize': [300, 600],
371373
}
372374
},
@@ -382,6 +384,7 @@ describe('freewheelSSP BidAdapter Test', () => {
382384
const payload = request[0].data;
383385
expect(payload.video_context).to.equal('outstream'); ;
384386
expect(payload.video_placement).to.equal(2);
387+
expect(payload.video_plcmt).to.equal(3);
385388
});
386389
})
387390

0 commit comments

Comments
 (0)