diff --git a/modules/smartadserverBidAdapter.js b/modules/smartadserverBidAdapter.js index 9146bba6514..923223f70c2 100644 --- a/modules/smartadserverBidAdapter.js +++ b/modules/smartadserverBidAdapter.js @@ -132,18 +132,19 @@ export const spec = { * @returns positive integer value of startdelay */ getStartDelayForVideoBidRequest: function(videoMediaType, videoParams) { - if (videoParams !== undefined && videoParams.startDelay) { + if (videoParams?.startDelay) { return videoParams.startDelay; - } else if (videoMediaType !== undefined) { - if (videoMediaType.startdelay == 0) { - return 1; - } else if (videoMediaType.startdelay == -1) { - return 2; - } else if (videoMediaType.startdelay == -2) { - return 3; + } else if (videoMediaType) { + switch (videoMediaType) { + case 0: + return 1; + case -1: + return 2; + case -2: + return 3; } } - return 2;// Default value for all exotic cases set to bid.params.video.startDelay midroll hence 2. + return 1; // SADR-5619 }, /** diff --git a/test/spec/modules/smartadserverBidAdapter_spec.js b/test/spec/modules/smartadserverBidAdapter_spec.js index 58b4cd8c0d0..d76a7b882f0 100644 --- a/test/spec/modules/smartadserverBidAdapter_spec.js +++ b/test/spec/modules/smartadserverBidAdapter_spec.js @@ -787,7 +787,7 @@ describe('Smart bid adapter tests', function () { const requestContent = JSON.parse(request[0].data); expect(requestContent).to.have.property('videoData'); expect(requestContent.videoData).not.to.have.property('videoProtocol').eq(true); - expect(requestContent.videoData).to.have.property('adBreak').and.to.equal(2); + expect(requestContent.videoData).to.have.property('adBreak').and.to.equal(1); }); it('Verify videoData params override meta values', function () { @@ -1097,7 +1097,7 @@ describe('Smart bid adapter tests', function () { const requestContent = JSON.parse(request[0].data); expect(requestContent).to.have.property('videoData'); expect(requestContent.videoData).not.to.have.property('videoProtocol').eq(true); - expect(requestContent.videoData).to.have.property('adBreak').and.to.equal(2); + expect(requestContent.videoData).to.have.property('adBreak').and.to.equal(1); }); it('Verify videoData params override meta values', function () {