Skip to content

Commit

Permalink
FreeWheel SSP Adapter: add support for video.plcmt (#9978)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
xwang202 committed May 22, 2023
1 parent f0e7488 commit 1a5ad0c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 10 additions & 2 deletions modules/freewheel-sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ export const spec = {
var timeInMillis = new Date().getTime();
var keyCode = hashcode(zone + '' + timeInMillis);
var bidfloor = getBidFloor(currentBidRequest, config);
var format = currentBidRequest.params.format;

var requestParams = {
reqType: 'AdsSetup',
Expand Down Expand Up @@ -435,10 +436,17 @@ export const spec = {

// Add video context and placement in requestParams
if (currentBidRequest.mediaTypes.video) {
var videoContext = currentBidRequest.mediaTypes.video.context ? currentBidRequest.mediaTypes.video.context : 'instream';
var videoPlacement = currentBidRequest.mediaTypes.video.placement ? currentBidRequest.mediaTypes.video.placement : 1;
var videoContext = currentBidRequest.mediaTypes.video.context ? currentBidRequest.mediaTypes.video.context : '';
var videoPlacement = currentBidRequest.mediaTypes.video.placement ? currentBidRequest.mediaTypes.video.placement : null;
var videoPlcmt = currentBidRequest.mediaTypes.video.plcmt ? currentBidRequest.mediaTypes.video.plcmt : null;

if (format == 'inbanner') {
videoPlacement = 2;
videoContext = 'In-Banner';
}
requestParams.video_context = videoContext;
requestParams.video_placement = videoPlacement;
requestParams.video_plcmt = videoPlcmt;
}

return {
Expand Down
7 changes: 5 additions & 2 deletions test/spec/modules/freewheel-sspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,9 @@ describe('freewheelSSP BidAdapter Test', () => {
it('should return context and placement with default values', () => {
const request = spec.buildRequests(bidRequests);
const payload = request[0].data;
expect(payload.video_context).to.equal('instream'); ;
expect(payload.video_placement).to.equal(1);
expect(payload.video_context).to.equal(''); ;
expect(payload.video_placement).to.equal(null);
expect(payload.video_plcmt).to.equal(null);
});

it('should add parameters to the tag', () => {
Expand Down Expand Up @@ -367,6 +368,7 @@ describe('freewheelSSP BidAdapter Test', () => {
'video': {
'context': 'outstream',
'placement': 2,
'plcmt': 3,
'playerSize': [300, 600],
}
},
Expand All @@ -382,6 +384,7 @@ describe('freewheelSSP BidAdapter Test', () => {
const payload = request[0].data;
expect(payload.video_context).to.equal('outstream'); ;
expect(payload.video_placement).to.equal(2);
expect(payload.video_plcmt).to.equal(3);
});
})

Expand Down

0 comments on commit 1a5ad0c

Please sign in to comment.