Skip to content

Commit 31e69e8

Browse files
committed
admatic adapter video params update
1 parent dcfc9fe commit 31e69e8

File tree

3 files changed

+33
-17
lines changed

3 files changed

+33
-17
lines changed

modules/admaticBidAdapter.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ export const spec = {
109109
meta: {
110110
advertiserDomains: bid && bid.adomain ? bid.adomain : []
111111
},
112-
ttl: 360,
113-
bidder: bid.bidder
112+
bidder: bid.bidder,
113+
mediaType: bid.type,
114+
ttl: 360
114115
};
115116

116117
bidResponses.push(resbid);
@@ -168,6 +169,14 @@ function parseSize(size) {
168169
function buildRequestObject(bid) {
169170
const reqObj = {};
170171
reqObj.size = getSizes(bid);
172+
if (bid.mediaTypes?.banner) {
173+
reqObj.type = 'banner';
174+
reqObj.mediatype = {};
175+
}
176+
if (bid.mediaTypes?.video) {
177+
reqObj.type = 'video';
178+
reqObj.mediatype = bid.mediaTypes.video;
179+
}
171180
reqObj.id = getBidIdParameter('bidId', bid);
172181

173182
enrichSlotWithFloors(reqObj, bid);

package-lock.json

+11-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/spec/modules/admaticBidAdapter_spec.js

+11-8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ describe('admaticBidAdapter', () => {
2222
'host': 'layer.serve.admatic.com.tr'
2323
},
2424
'adUnitCode': 'adunit-code',
25+
'mediaType': 'banner',
2526
'sizes': [[300, 250], [300, 600]],
2627
'bidId': '30b31c1838de1e',
2728
'bidderRequestId': '22edbae2733bf6',
@@ -34,15 +35,11 @@ describe('admaticBidAdapter', () => {
3435
});
3536

3637
it('should return false when required params are not passed', function() {
37-
let bid = Object.assign({}, bid);
38-
delete bid.params;
39-
40-
bid.params = {
41-
'networkId': 0,
42-
'host': 'layer.serve.admatic.com.tr'
38+
let bid2 = {};
39+
bid2.params = {
40+
'someIncorrectParam': 0
4341
};
44-
45-
expect(spec.isBidRequestValid(bid)).to.equal(false);
42+
expect(spec.isBidRequestValid(bid2)).to.equal(false);
4643
});
4744
});
4845

@@ -98,6 +95,8 @@ describe('admaticBidAdapter', () => {
9895
'h': 90
9996
}
10097
],
98+
'mediatype': {},
99+
'type': 'banner',
101100
'id': '2205da7a81846b',
102101
'floors': {
103102
'banner': {
@@ -163,6 +162,8 @@ describe('admaticBidAdapter', () => {
163162
}
164163
],
165164
'id': '2205da7a81846b',
165+
'mediatype': {},
166+
'type': 'banner',
166167
'floors': {
167168
'banner': {
168169
'300x250': { 'currency': 'USD', 'floor': 1 },
@@ -249,6 +250,7 @@ describe('admaticBidAdapter', () => {
249250
'width': 300,
250251
'height': 250,
251252
'price': 0.01,
253+
'type': 'banner',
252254
'bidder': 'admatic',
253255
'adomain': ['admatic.com.tr'],
254256
'party_tag': '<div></div>'
@@ -265,6 +267,7 @@ describe('admaticBidAdapter', () => {
265267
width: 300,
266268
height: 250,
267269
currency: 'TRY',
270+
mediaType: 'banner',
268271
netRevenue: true,
269272
ad: '<div></div>',
270273
creativeId: '374',

0 commit comments

Comments
 (0)