Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions modules/smartadserverBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,11 @@ export const spec = {
getStartDelayForVideoBidRequest: function(videoMediaType, videoParams) {
if (videoParams?.startDelay) {
return videoParams.startDelay;
} else if (videoMediaType) {
switch (videoMediaType.startdelay) {
case -1:
return 2;
case -2:
return 3;
} else if (videoMediaType?.startdelay) {
if (videoMediaType.startdelay > 0 || videoMediaType.startdelay == -1) {
return 2;
} else if (videoMediaType.startdelay == -2) {
return 3;
}
}
return 1; // SADR-5619
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 @@ -1165,6 +1165,28 @@ describe('Smart bid adapter tests', function () {
expect(requestContent).to.have.property('videoData');
expect(requestContent.videoData).to.have.property('adBreak').and.to.equal(3);
});

it('should return specified value of videoMediaType.startdelay', function () {
const request = spec.buildRequests([{
bidder: 'smartadserver',
mediaTypes: {
video: {
context: 'outstream',
playerSize: [[640, 480]],
startdelay: 60
}
},
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(2);
});
});

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