Skip to content

Commit

Permalink
33across - use video.plcmt instead of video.placement
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosfelix committed May 16, 2024
1 parent ff458c5 commit 84a6670
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions modules/33acrossBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const VIDEO_ORTB_PARAMS = [
'mimes',
'minduration',
'maxduration',
'placement',
'plcmt',
'protocols',
'startdelay',
'skip',
Expand Down Expand Up @@ -141,8 +141,8 @@ function _validateVideo(bid) {

// If placement if defined, it must be a number
if (
typeof videoParams.placement !== 'undefined' &&
typeof videoParams.placement !== 'number'
typeof videoParams.plcmt !== 'undefined' &&
typeof videoParams.plcmt !== 'number'
) {
return false;
}
Expand Down Expand Up @@ -491,11 +491,11 @@ function _buildVideoORTB(bidRequest) {
// Placement Inference Rules:
// - If no placement is defined then default to 2 (In Banner)
// - If product is instream (for instream context) then override placement to 1
video.placement = video.placement || 2;
video.plcmt = video.plcmt || 2;

if (product === PRODUCT.INSTREAM) {
video.startdelay = video.startdelay || 0;
video.placement = 1;
video.plcmt = 1;
}

// bidfloors
Expand Down
16 changes: 8 additions & 8 deletions test/spec/modules/33acrossBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe('33acrossBidAdapter:', function () {
video: {
w: 300,
h: 250,
placement: 2,
plcmt: 2,
...params
}
});
Expand Down Expand Up @@ -734,7 +734,7 @@ describe('33acrossBidAdapter:', function () {
];

invalidPlacement.forEach((placement) => {
this.bid.mediaTypes.video.placement = placement;
this.bid.mediaTypes.video.plcmt = placement;
expect(spec.isBidRequestValid(this.bid)).to.be.false;
});
});
Expand Down Expand Up @@ -1533,7 +1533,7 @@ describe('33acrossBidAdapter:', function () {
.withProduct('instream')
.build();

ttxRequest.imp[0].video.placement = 1;
ttxRequest.imp[0].video.plcmt = 1;
ttxRequest.imp[0].video.startdelay = 0;

const serverRequest = new ServerRequestBuilder()
Expand All @@ -1552,7 +1552,7 @@ describe('33acrossBidAdapter:', function () {
);

const ttxRequest = new TtxRequestBuilder()
.withVideo({startdelay: -2, placement: 1})
.withVideo({startdelay: -2, plcmt: 1})
.withProduct('instream')
.build();

Expand All @@ -1575,7 +1575,7 @@ describe('33acrossBidAdapter:', function () {
.withProduct('siab')
.build();

ttxRequest.imp[0].video.placement = 2;
ttxRequest.imp[0].video.plcmt = 2;

const serverRequest = new ServerRequestBuilder()
.withData(ttxRequest)
Expand All @@ -1588,12 +1588,12 @@ describe('33acrossBidAdapter:', function () {
it('builds siab request with video params passed', function() {
const bidRequests = (
new BidRequestsBuilder()
.withVideo({context: 'outstream', placement: 3, playbackmethod: [2]})
.withVideo({context: 'outstream', plcmt: 3, playbackmethod: [2]})
.build()
);

const ttxRequest = new TtxRequestBuilder()
.withVideo({placement: 3, playbackmethod: [2]})
.withVideo({plcmt: 3, playbackmethod: [2]})
.withProduct('siab')
.build();

Expand Down Expand Up @@ -1686,7 +1686,7 @@ describe('33acrossBidAdapter:', function () {
.withProduct('siab')
.build();

ttxRequest.imp[0].video.placement = 2;
ttxRequest.imp[0].video.plcmt = 2;

const serverRequest = new ServerRequestBuilder()
.withData(ttxRequest)
Expand Down

0 comments on commit 84a6670

Please sign in to comment.