-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rubicon able to read mediaTypes.size #2607
Conversation
checkBidRequestSizes is normally present in adaptermanager.js to add the mediaTypes.banner.sizes to bid.sizes. However our adapter need to be able to read these fields in case the method is deprecated. Same for the Video.
modules/rubiconBidAdapter.js
Outdated
sizes = mapSizes(bid.mediaTypes.banner.sizes); | ||
} else { | ||
sizes = Array.isArray(params.sizes) ? params.sizes : mapSizes(bid.sizes) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If params.sizes
is present it should be used over both bid.sizes
and mediaTypes.banner.sizes
, so this logic needs to be adjusted.
if (params.video && params.video.playerWidth && params.video.playerHeight) { | ||
if (typeof utils.deepAccess(bid, 'mediaTypes.video.playerSize') !== 'undefined') { | ||
size = bid.mediaTypes.video.playerSize; | ||
} else if (params.video && params.video.playerWidth && params.video.playerHeight) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@idettman can you review this part to make sure this looks correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix params.sizes
to have highest priority.
@snapwich , I have edited the change to first look at Rubicon size. Thanks, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I discussed with Bobby, and the only issue is changing the second and third else if positions Line #526 and #528 so that banner sizes override bid sizes if present.
So Line 524 - 532 should be:
if (Array.isArray(params.sizes)) {
sizes = params.sizes;
} else if (typeof utils.deepAccess(bid, 'mediaTypes.banner.sizes') !== 'undefined') {
sizes = mapSizes(bid.mediaTypes.banner.sizes);
} else if (Array.isArray(bid.sizes) && bid.sizes.length > 0) {
sizes = mapSizes(bid.sizes)
} else {
utils.logWarn('Warning: no sizes are setup or found');
}
@idettman, Thanks, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description of change
checkBidRequestSizes is normally present in adaptermanager.js to add the mediaTypes.banner.sizes to bid.sizes. However our adapter need to be able to read these fields in case the method is deprecated.
Same for the Video.
Be sure to test the integration with your adserver using the Hello World sample page.
For any changes that affect user-facing APIs or example code documented on http://prebid.org, please provide:
Other information