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

Add video ad support to ablida bid adapter #5782

Merged
merged 11 commits into from
Sep 25, 2020
8 changes: 5 additions & 3 deletions modules/ablidaBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as utils from '../src/utils.js';
import {config} from '../src/config.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import { BANNER, NATIVE } from '../src/mediaTypes.js';
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';

const BIDDER_CODE = 'ablida';
const ENDPOINT_URL = 'https://bidder.ablida.net/prebid';

export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [BANNER, NATIVE],
supportedMediaTypes: [BANNER, NATIVE, VIDEO],

/**
* Determines whether or not the given bid request is valid.
Expand All @@ -35,6 +35,8 @@ export const spec = {
let sizes = []
if (bidRequest.mediaTypes && bidRequest.mediaTypes[BANNER] && bidRequest.mediaTypes[BANNER].sizes) {
sizes = bidRequest.mediaTypes[BANNER].sizes;
} else if (bidRequest.mediaTypes[VIDEO] && bidRequest.mediaTypes[VIDEO].playerSize) {
sizes = bidRequest.mediaTypes[VIDEO].playerSize
}
const jaySupported = 'atob' in window && 'currentScript' in document;
const device = getDevice();
Expand All @@ -46,7 +48,7 @@ export const spec = {
referer: bidderRequest.refererInfo.referer,
jaySupported: jaySupported,
device: device,
adapterVersion: 4,
adapterVersion: 5,
mediaTypes: bidRequest.mediaTypes,
gdprConsent: bidderRequest.gdprConsent
};
Expand Down
16 changes: 16 additions & 0 deletions modules/ablidaBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ Module that connects to Ablida's bidder for bids.
}
}
]
}, {
code: 'video-ad',
mediaTypes: {
video: {
playerSize: [[640, 360]],
context: 'instream'
}
},
bids: [
{
bidder: 'ablida',
params: {
placementId: 'instream-demo'
}
}
]
}
];
```
2 changes: 1 addition & 1 deletion test/spec/modules/ablidaBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('ablidaBidAdapter', function () {
method: 'POST',
url: ENDPOINT_URL,
data: {
adapterVersion: 4,
adapterVersion: 5,
bidId: '2b8c4de0116e54',
categories: undefined,
device: 'desktop',
Expand Down