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

Yieldmo Bid Adapter : adding support for video.plcmt #10841

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/yieldmoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const VIDEO_PATH = '/exchange/prebidvideo';
const STAGE_DOMAIN = 'https://ads-stg.yieldmo.com';
const PROD_DOMAIN = 'https://ads.yieldmo.com';
const OUTSTREAM_VIDEO_PLAYER_URL = 'https://prebid-outstream.yieldmo.com/bundle.js';
const OPENRTB_VIDEO_BIDPARAMS = ['mimes', 'startdelay', 'placement', 'startdelay', 'skipafter', 'protocols', 'api',
const OPENRTB_VIDEO_BIDPARAMS = ['mimes', 'startdelay', 'placement', 'plcmt', 'skipafter', 'protocols', 'api',
'playbackmethod', 'maxduration', 'minduration', 'pos', 'skip', 'skippable'];
const OPENRTB_VIDEO_SITEPARAMS = ['name', 'domain', 'cat', 'keywords'];
const LOCAL_WINDOW = getWindowTop();
Expand Down Expand Up @@ -449,7 +449,7 @@ function openRtbImpression(bidRequest) {
imp.video.skip = 1;
delete imp.video.skippable;
}
if (imp.video.placement !== 1) {
if (imp.video.plcmt !== 1 || imp.video.placement !== 1) {
imp.video.startdelay = DEFAULT_START_DELAY;
imp.video.playbackmethod = [ DEFAULT_PLAYBACK_METHOD ];
}
Expand Down
18 changes: 14 additions & 4 deletions test/spec/modules/yieldmoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('YieldmoAdapter', function () {
video: {
playerSize: [640, 480],
context: 'instream',
mimes: ['video/mp4']
mimes: ['video/mp4'],
},
},
params: {
Expand All @@ -61,11 +61,11 @@ describe('YieldmoAdapter', function () {
api: [2, 3],
skipppable: true,
playbackmethod: [1, 2],
...videoParams
}
...videoParams,
},
},
transactionId: '54a58774-7a41-494e-8cbc-fa7b79164f0c',
...rootParams
...rootParams,
});

const mockBidderRequest = (params = {}, bids = [mockBannerBid()]) => ({
Expand Down Expand Up @@ -460,6 +460,16 @@ describe('YieldmoAdapter', function () {
expect(buildVideoBidAndGetVideoParam().minduration).to.deep.equal(['video/mp4']);
});

it('should add plcmt value to the imp.video', function () {
const videoBid = mockVideoBid({}, {}, { plcmt: 1 });
expect(utils.deepAccess(videoBid, 'params.video')['plcmt']).to.equal(1);
});

it('should add start delay if plcmt value is not 1', function () {
const videoBid = mockVideoBid({}, {}, { plcmt: 2 });
expect(build([videoBid])[0].data.imp[0].video.startdelay).to.equal(0);
});

it('should override mediaTypes.video.mimes prop if params.video.mimes is present', function () {
utils.deepAccess(videoBid, 'mediaTypes.video')['mimes'] = ['video/mp4'];
utils.deepAccess(videoBid, 'params.video')['mimes'] = ['video/mkv'];
Expand Down