Skip to content

Commit

Permalink
RubiconBidAdapter: sync parseSize algorithm for isBidRequestValid and…
Browse files Browse the repository at this point in the history
… ortb conversion (#9957)

* sync parseSize algorithm for isBidRequestValid and ortb conversion

* use same sizes of parseSizes in video outstream

* general test refactor to be less flacky

---------

Co-authored-by: Michele Nasti <michele@rtk.io>
  • Loading branch information
musikele and Michele Nasti authored May 16, 2023
1 parent 1e25e29 commit 667bbda
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 69 deletions.
6 changes: 4 additions & 2 deletions modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,10 @@ export const converter = ortbConverter({
bidResponse.meta.mediaType = deepAccess(bid, 'ext.prebid.type');
const {bidRequest} = context;

bidResponse.width = bid.w || deepAccess(bidRequest, 'mediaTypes.video.w') || deepAccess(bidRequest, 'params.video.playerWidth') || bidResponse.playerWidth;
bidResponse.height = bid.h || deepAccess(bidRequest, 'mediaTypes.video.h') || deepAccess(bidRequest, 'params.video.playerHeight') || bidResponse.playerHeight;
let [parseSizeWidth, parseSizeHeight] = bidRequest.mediaTypes.video?.context === 'outstream' ? parseSizes(bidRequest, VIDEO) : [undefined, undefined];

bidResponse.width = bid.w || parseSizeWidth || bidResponse.playerWidth;
bidResponse.height = bid.h || parseSizeHeight || bidResponse.playerHeight;

if (bidResponse.mediaType === VIDEO && bidRequest.mediaTypes.video.context === 'outstream') {
bidResponse.renderer = outstreamRenderer(bidResponse);
Expand Down
Loading

0 comments on commit 667bbda

Please sign in to comment.