Skip to content

Commit

Permalink
resolve conflicts with prebid-server video changes
Browse files Browse the repository at this point in the history
  • Loading branch information
snapwich committed Jul 12, 2019
1 parent e629615 commit 6c02b22
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions modules/prebidServerBidAdapter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { STATUS, S2S, EVENTS } from '../../src/constants';
import adapterManager from '../../src/adapterManager';
import { config } from '../../src/config';
import { VIDEO, NATIVE } from '../../src/mediaTypes';
import { processNativeAdUnitParams } from 'src/native';
import { processNativeAdUnitParams } from '../../src/native';
import { isValid } from '../../src/adapters/bidderFactory';
import events from '../../src/events';
import includes from 'core-js/library/fn/array/includes';
Expand Down Expand Up @@ -508,7 +508,12 @@ const OPEN_RTB_PROTOCOL = {

const videoParams = utils.deepAccess(adUnit, 'mediaTypes.video');
if (!utils.isEmpty(videoParams)) {
mediaTypes['video'] = videoParams;
if (videoParams.context === 'outstream' && !adUnit.renderer) {
// Don't push oustream w/o renderer to request object.
utils.logError('Outstream bid without renderer cannot be sent to Prebid Server.');
} else {
mediaTypes['video'] = videoParams;
}
}

const nativeParams = processNativeAdUnitParams(utils.deepAccess(adUnit, 'mediaTypes.native'));
Expand Down Expand Up @@ -596,16 +601,11 @@ const OPEN_RTB_PROTOCOL = {

const imp = { id: adUnit.code, ext, secure: _s2sConfig.secure };

if (banner) { imp.banner = banner; }
if (video) {
if (video.context === 'outstream' && !adUnit.renderer) {
// Don't push oustream w/o renderer to request object.
utils.logError('Outstream bid without renderer cannot be sent to Prebid Server.');
} else {
imp.video = video;
}
Object.assign(imp, mediaTypes);

if (imp.banner || imp.video || imp.native) {
imps.push(imp);
}
if (imp.banner || imp.video) { imps.push(imp); }
});

if (!imps.length) {
Expand Down

0 comments on commit 6c02b22

Please sign in to comment.