Skip to content

Commit

Permalink
allow outstream when placement is inStream (prebid#12440)
Browse files Browse the repository at this point in the history
  • Loading branch information
ybootin authored Nov 13, 2024
1 parent ee9534b commit 04ae817
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 19 deletions.
2 changes: 1 addition & 1 deletion modules/seedtagBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function hasMandatoryVideoParams(bid) {
switch (bid.params.placement) {
// instream accept only video format
case 'inStream':
return isValid && videoParams.context === 'instream';
return isValid && (videoParams.context === 'instream' || videoParams.context === 'outstream');
// outstream accept banner/native/video format
default:
return (
Expand Down
67 changes: 49 additions & 18 deletions test/spec/modules/seedtagBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,21 @@ describe('Seedtag Adapter', function () {
}
);

it(
placement +
' shouldn\'t be valid when has only video mediatypes, and video context is outstream',
function () {
const isBidRequestValid = spec.isBidRequestValid(
createBannerSlotConfig(placement, {
video: {
context: 'outstream',
playerSize: [[600, 200]],
},
})
);
expect(isBidRequestValid).to.equal(false);
}
);
it(
placement +
" shouldn't be valid when has display and video mediatypes, and video context is instream",
Expand Down Expand Up @@ -155,15 +170,41 @@ describe('Seedtag Adapter', function () {
const isBidRequestValid = spec.isBidRequestValid(slotConfig);
expect(isBidRequestValid).to.equal(false);
});
it('should return false, when video context is outstream', function () {
const slotConfig = createInStreamSlotConfig({
video: {
context: 'outstream',
playerSize: [[600, 200]],

it('should return true when placement is inStream and video context is outstream', function () {
const slotConfig = getSlotConfigs(
{
video: {
context: 'instream',
playerSize: [[600, 200]],
},
},
});
{
publisherId: PUBLISHER_ID,
adUnitId: ADUNIT_ID,
placement: 'inStream',
}
);
const isBidRequestValid = spec.isBidRequestValid(slotConfig);
expect(isBidRequestValid).to.equal(false);
expect(isBidRequestValid).to.equal(true);
});

it('should return true when placement is inStream and video context is instream', function () {
const slotConfig = getSlotConfigs(
{
video: {
context: 'outstream',
playerSize: [[600, 200]],
},
},
{
publisherId: PUBLISHER_ID,
adUnitId: ADUNIT_ID,
placement: 'inStream',
}
);
const isBidRequestValid = spec.isBidRequestValid(slotConfig);
expect(isBidRequestValid).to.equal(true);
});
});
});
Expand Down Expand Up @@ -224,17 +265,7 @@ describe('Seedtag Adapter', function () {
);
expect(isBidRequestValid).to.equal(false);
});
it('is outstream ', function () {
const isBidRequestValid = spec.isBidRequestValid(
createInStreamSlotConfig({
video: {
context: 'outstream',
playerSize: [[600, 200]],
},
})
);
expect(isBidRequestValid).to.equal(false);
});

describe('order does not matter', function () {
it('when video is not the first slot', function () {
const isBidRequestValid = spec.isBidRequestValid(
Expand Down

0 comments on commit 04ae817

Please sign in to comment.