Skip to content

Commit

Permalink
Include videoMediaType's startdelay
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofequativ committed Mar 19, 2024
1 parent 2eb6fd8 commit 78f1201
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
4 changes: 1 addition & 3 deletions modules/smartadserverBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ export const spec = {
if (videoParams?.startDelay) {
return videoParams.startDelay;
} else if (videoMediaType) {
switch (videoMediaType) {
case 0:
return 1;
switch (videoMediaType.startdelay) {
case -1:
return 2;
case -2:
Expand Down
22 changes: 22 additions & 0 deletions test/spec/modules/smartadserverBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,28 @@ describe('Smart bid adapter tests', function () {
expect(requestContent.videoData).to.have.property('videoProtocol').and.to.equal(6);
expect(requestContent.videoData).to.have.property('adBreak').and.to.equal(3);
});

it('should handle value of videoMediaType.startdelay', function () {
const request = spec.buildRequests([{
bidder: 'smartadserver',
mediaTypes: {
video: {
context: 'outstream',
playerSize: [[640, 480]],
startdelay: -2
}
},
params: {
siteId: 123,
pageId: 456,
formatId: 78
}
}]);

const requestContent = JSON.parse(request[0].data);
expect(requestContent).to.have.property('videoData');
expect(requestContent.videoData).to.have.property('adBreak').and.to.equal(3);
});
});

describe('External ids tests', function () {
Expand Down

0 comments on commit 78f1201

Please sign in to comment.