-
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
Fixes #2276 - video.playerSize and Size Mapping not working together #2311
Conversation
src/adaptermanager.js
Outdated
return Array.isArray(val) && val.length === 2 && utils.isInteger(val[0]) && utils.isInteger(val[1]); | ||
} | ||
|
||
// Array.prototype.forEach.call(adUnits, adUnit => { |
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.
Can drop this line if no longer needed
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.
Removed it.
@matthewlane Per your separate feedback, I added support for the I'll update the original description in lieu of the functionality change. |
…ether (prebid#2311) * initial commit - fix to make playerSize and sizeConfig work * removed commented from testing * adding support to use [300, 600] syntax in video.playerSize field
Type of change
Description of change
Currently, using Size Mapping functionality with a video adUnit that specifies
mediaTypes.video.playerSize
would not pass thesizeMapping.js
validation checks causing the ad unit to not be included in thebidRequest
object.As a quick recap, the validation check in the sizeMapping (located here https://github.com/prebid/Prebid.js/blob/master/src/sizeMapping.js#L41) does the following:
[[300, 250], [300, 600]]
) as a list of acceptable sizes (this is derived from the matching mediaQuery params).Because the filtering operates on a list of arrayed sizes, the adUnits.sizes has to use the same format. Otherwise, the filter would treat the single array of sizes ie
[300, 250]
as two integers and the size wouldn't pass the check.To meet this requirement, I changed the
adUnits.mediaTypes.video.playerSize
field to accept either format (ie[[640, 480]]
or[640, 480]
) but it will automatically format the latter syntax into the former.A note - while the
playerSize
field will expect an array of an array, there should only 1 set of sizes in the field. The changes in thecheckBidRequestSizes()
function check for this exact type of setup.Other information
fixes issue reported in #2276