Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Digital Bid Adapter: remove video.placement #11658

Merged
merged 10 commits into from
Jun 3, 2024
10 changes: 1 addition & 9 deletions modules/improvedigitalBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ const EXTEND_URL = 'https://pbs.360yield.com/openrtb2/auction';
const IFRAME_SYNC_URL = 'https://hb.360yield.com/prebid-universal-creative/load-cookie.html';

const VIDEO_PARAMS = {
DEFAULT_MIMES: ['video/mp4'],
PLACEMENT_TYPE: {
INSTREAM: 1,
OUTSTREAM: 3,
}
DEFAULT_MIMES: ['video/mp4']
};

export const spec = {
Expand Down Expand Up @@ -232,10 +228,6 @@ export const CONVERTER = ortbConverter({
context
);
deepSetValue(imp, 'ext.is_rewarded_inventory', (video.rewarded === 1 || deepAccess(video, 'ext.rewarded') === 1) || undefined);
if (!imp.video.placement && ID_REQUEST.isOutstreamVideo(bidRequest)) {
// fillImpVideo will have already set placement = 1 for instream
imp.video.placement = VIDEO_PARAMS.PLACEMENT_TYPE.OUTSTREAM;
}
}
}
}
Expand Down
27 changes: 2 additions & 25 deletions test/spec/modules/improvedigitalBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ describe('Improve Digital Adapter Tests', function () {
},
...(FEATURES.VIDEO && {
video: {
placement: OUTSTREAM_TYPE,
w: 640,
h: 480,
mimes: ['video/mp4'],
Expand Down Expand Up @@ -474,25 +473,6 @@ describe('Improve Digital Adapter Tests', function () {
});

if (FEATURES.VIDEO) {
it('should add correct placement value for instream and outstream video', function () {
let bidRequest = deepClone(simpleBidRequest);
let payload = JSON.parse(spec.buildRequests([bidRequest], bidderRequest)[0].data);
expect(payload.imp[0].video).to.not.exist;

bidRequest = deepClone(simpleBidRequest);
bidRequest.mediaTypes = {
video: {
context: 'instream',
playerSize: [640, 480]
}
};
payload = JSON.parse(spec.buildRequests([bidRequest], bidderRequest)[0].data);
expect(payload.imp[0].video.placement).to.exist.and.equal(1);
bidRequest.mediaTypes.video.context = 'outstream';
payload = JSON.parse(spec.buildRequests([bidRequest], bidderRequest)[0].data);
expect(payload.imp[0].video.placement).to.exist.and.equal(3);
});

it('should set video params for instream', function() {
const bidRequest = deepClone(instreamBidRequest);
delete bidRequest.mediaTypes.video.playerSize;
Expand All @@ -507,13 +487,12 @@ describe('Improve Digital Adapter Tests', function () {
minbitrate: 500,
maxbitrate: 2000,
w: 1024,
h: 640,
placement: INSTREAM_TYPE,
h: 640
};
bidRequest.params.video = videoParams;
const request = spec.buildRequests([bidRequest], bidderRequest)[0];
const payload = JSON.parse(request.data);
expect(payload.imp[0].video).to.deep.equal(videoParams);
expect(payload.imp[0].video).to.deep.include(videoParams);
});

it('should set video playerSize over video params', () => {
Expand Down Expand Up @@ -550,7 +529,6 @@ describe('Improve Digital Adapter Tests', function () {
const payload = JSON.parse(request.data);
expect(payload.imp[0].video).to.deep.equal({...{
mimes: ['video/mp4'],
placement: OUTSTREAM_TYPE,
w: bidRequest.mediaTypes.video.playerSize[0],
h: bidRequest.mediaTypes.video.playerSize[1],
},
Expand All @@ -563,7 +541,6 @@ describe('Improve Digital Adapter Tests', function () {
const request = spec.buildRequests([bidRequest], {})[0];
const payload = JSON.parse(request.data);
const testVideoParams = Object.assign({
placement: OUTSTREAM_TYPE,
w: 640,
h: 480,
mimes: ['video/mp4'],
Expand Down