Skip to content

Commit

Permalink
Add video ad support to ablida bid adapter (#5782)
Browse files Browse the repository at this point in the history
* add onBidWon function, add bidder adapter version to bid requests

* add support for native

* use triggerPxel instead of ajax, because ajax was called 3 times with native

* add gdpr consent to bid requests

* update tests

* add video ad support
  • Loading branch information
Dan committed Sep 25, 2020
1 parent 0fd7205 commit c8176d7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
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

0 comments on commit c8176d7

Please sign in to comment.