Skip to content

Commit

Permalink
Dailymotion bid adapter: Add standard ORTB video parameters
Browse files Browse the repository at this point in the history
Note: I changed the case of `startdelay` to be consistent with the other parameters, but it won't have any impact on current deployments as this parameter is not used onsite.
  • Loading branch information
sebmil-daily committed Apr 19, 2024
1 parent 50dda1f commit b4f2c58
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 14 deletions.
16 changes: 14 additions & 2 deletions modules/dailymotionBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,21 @@ export const spec = {
bidId: bid.bidId || '',
mediaTypes: {
video: {
playerSize: bid.mediaTypes?.[VIDEO]?.playerSize || [],
api: bid.mediaTypes?.[VIDEO]?.api || [],
startDelay: bid.mediaTypes?.[VIDEO]?.startdelay || 0,
ext: bid.mediaTypes?.[VIDEO]?.ext || {},
maxseq: bid.mediaTypes?.[VIDEO]?.maxseq || 0,
mimes: bid.mediaTypes?.[VIDEO]?.mimes || [],
minduration: bid.mediaTypes?.[VIDEO]?.minduration || 0,
maxduration: bid.mediaTypes?.[VIDEO]?.maxduration || 0,
poddur: bid.mediaTypes?.[VIDEO]?.poddur || 0,
protocols: bid.mediaTypes?.[VIDEO]?.protocols || [],
rqddurs: bid.mediaTypes?.[VIDEO]?.rqddurs || [],
skip: bid.mediaTypes?.[VIDEO]?.skip || 0,
skipafter: bid.mediaTypes?.[VIDEO]?.skipafter || 0,
skipmin: bid.mediaTypes?.[VIDEO]?.skipmin || 0,
startdelay: bid.mediaTypes?.[VIDEO]?.startdelay || 0,
w: bid.mediaTypes?.[VIDEO]?.w || 0,
h: bid.mediaTypes?.[VIDEO]?.h || 0,
},
},
sizes: bid.sizes || [],
Expand Down
14 changes: 9 additions & 5 deletions modules/dailymotionBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ Maintainer: ad-leo-engineering@dailymotion.com

# Description

Dailymotion prebid adapter.
Dailymotion prebid adapter for VOD.

This adapter allows you to leverage Dailymotion ad stack in any linear video context.

# Configuration options

Expand Down Expand Up @@ -69,8 +71,9 @@ const adUnits = [
video: {
api: [2, 7],
context: 'instream',
playerSize: [ [1280, 720] ],
startDelay: 0,
startdelay: 0,
w: 1280,
h: 720,
xid: 'x123456' // Dailymotion infrastructure unique video ID
},
}
Expand Down Expand Up @@ -105,12 +108,13 @@ const adUnits = [
iabcat2: ['6', '17'],
id: '54321',
lang: 'FR',
playerSize: [ [1280, 720] ],
private: false,
startDelay: 0,
startdelay: 0,
tags: 'tag_1,tag_2,tag_3',
title: 'test video',
topics: 'topic_1, topic_2',
w: 1280,
h: 720,
},
}
}
Expand Down
49 changes: 42 additions & 7 deletions test/spec/modules/dailymotionBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,26 @@ describe('dailymotionBidAdapterTests', () => {
adUnitCode: 'preroll',
mediaTypes: {
video: {
playerSize: [[1280, 720]],
api: [2, 7],
description: 'this is a test video',
duration: 300,
ext: {
test_ext: 'test ext value',
},
iabcat2: ['6', '17'],
lang: 'ENG',
mimes: ['video/mp4'],
minduration: 5,
maxduration: 30,
maxseq: 3,
poddur: 15,
protocols: [1, 2, 3, 4, 5, 6, 7, 8],
skip: 1,
skipafter: 5,
skipmin: 10,
startdelay: 0,
w: 1280,
h: 720
},
},
sizes: [[1920, 1080]],
Expand Down Expand Up @@ -115,8 +128,19 @@ describe('dailymotionBidAdapterTests', () => {
expect(reqData.request.auctionId).to.eql(bidRequestData[0].auctionId);
expect(reqData.request.bidId).to.eql(bidRequestData[0].bidId);
expect(reqData.request.mediaTypes.video.api).to.eql(bidRequestData[0].mediaTypes.video.api);
expect(reqData.request.mediaTypes.video.playerSize).to.eql(bidRequestData[0].mediaTypes.video.playerSize);
expect(reqData.request.mediaTypes.video.startDelay).to.eql(bidRequestData[0].mediaTypes.video.startdelay);
expect(reqData.request.mediaTypes.video.ext).to.eql(bidRequestData[0].mediaTypes.video.ext);
expect(reqData.request.mediaTypes.video.mimes).to.eql(bidRequestData[0].mediaTypes.video.mimes);
expect(reqData.request.mediaTypes.video.minduration).to.eql(bidRequestData[0].mediaTypes.video.minduration);
expect(reqData.request.mediaTypes.video.maxduration).to.eql(bidRequestData[0].mediaTypes.video.maxduration);
expect(reqData.request.mediaTypes.video.maxseq).to.eql(bidRequestData[0].mediaTypes.video.maxseq);
expect(reqData.request.mediaTypes.video.poddur).to.eql(bidRequestData[0].mediaTypes.video.poddur);
expect(reqData.request.mediaTypes.video.protocols).to.eql(bidRequestData[0].mediaTypes.video.protocols);
expect(reqData.request.mediaTypes.video.skip).to.eql(bidRequestData[0].mediaTypes.video.skip);
expect(reqData.request.mediaTypes.video.skipafter).to.eql(bidRequestData[0].mediaTypes.video.skipafter);
expect(reqData.request.mediaTypes.video.skipmin).to.eql(bidRequestData[0].mediaTypes.video.skipmin);
expect(reqData.request.mediaTypes.video.startdelay).to.eql(bidRequestData[0].mediaTypes.video.startdelay);
expect(reqData.request.mediaTypes.video.w).to.eql(bidRequestData[0].mediaTypes.video.w);
expect(reqData.request.mediaTypes.video.h).to.eql(bidRequestData[0].mediaTypes.video.h);
expect(reqData.video_metadata).to.eql({
description: bidRequestData[0].mediaTypes.video.description,
iabcat1: ['IAB-1'], // Taxonomy v2 or higher is excluded
Expand All @@ -140,7 +164,6 @@ describe('dailymotionBidAdapterTests', () => {
adUnitCode: 'preroll',
mediaTypes: {
video: {
playerSize: [[1280, 720]],
api: [2, 7],
description: 'this is a test video',
duration: 300,
Expand Down Expand Up @@ -251,7 +274,7 @@ describe('dailymotionBidAdapterTests', () => {
expect(reqData.request.bidId).to.eql(bidRequestData[0].bidId);
expect(reqData.request.mediaTypes.video.api).to.eql(bidRequestData[0].mediaTypes.video.api);
expect(reqData.request.mediaTypes.video.playerSize).to.eql(bidRequestData[0].mediaTypes.video.playerSize);
expect(reqData.request.mediaTypes.video.startDelay).to.eql(bidRequestData[0].mediaTypes.video.startdelay);
expect(reqData.request.mediaTypes.video.startdelay).to.eql(bidRequestData[0].mediaTypes.video.startdelay);
expect(reqData.video_metadata).to.eql({
description: bidRequestData[0].mediaTypes.video.description,
// No iabcat1 here because nothing matches taxonomy
Expand Down Expand Up @@ -310,9 +333,21 @@ describe('dailymotionBidAdapterTests', () => {
adUnitCode: '',
mediaTypes: {
video: {
playerSize: [],
startDelay: 0,
api: [],
ext: {},
maxseq: 0,
mimes: [],
minduration: 0,
maxduration: 0,
poddur: 0,
protocols: [],
rqddurs: [],
skip: 0,
skipafter: 0,
skipmin: 0,
startdelay: 0,
w: 0,
h: 0,
},
},
sizes: [],
Expand Down

0 comments on commit b4f2c58

Please sign in to comment.