Repository navigation
Add ortb values for new pause ads - #108
spacanowskiopenx wants to merge 9 commits into
Conversation
|
Whoa there, partner! 🌵🤠 We wrangled some duplicated code in your PR:
Reducing code duplication by importing common functions from a library not only makes our code cleaner but also easier to maintain. Please move the common code from both files into a library and import it in each. We hate that we have to mention this, however, commits designed to hide from this utility by renaming variables or reordering an object are poor conduct. We will not look upon them kindly! Keep up the great work! 🚀 |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Remove unsupported value 7 and add regression coverage for the new signals.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Adds OpenRTB video enum support for pause and screensaver ad signals in the MediaKeys adapter.
Changes:
- Expands accepted
plcmt,playbackmethod, andposvalues. - Updates video parameter validation.
| File | Summary |
|---|---|
modules/mediakeysBidAdapter.js |
Remove unsupported playbackmethod value 7 and add focused request assertions for the new signals. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: spacanowskiopenx <171801863+spacanowskiopenx@users.noreply.github.com>
Co-authored-by: spacanowskiopenx <171801863+spacanowskiopenx@users.noreply.github.com>
|
This PR introduces changes that may not work on all browsers. According to Babel, the following polyfills may be needed, and they are not automatically included:
The best way to address this is to provide good test coverage, as normal PR checks run unit tests on older browsers. |
…g for inline instream bids' Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| maxbitrate: value => isInteger(value), | ||
| boxingallowed: value => [0, 1].indexOf(value) !== -1, | ||
| playbackmethod: value => Array.isArray(value) && value.every(v => [1, 2, 3, 4, 5, 6].indexOf(v) !== -1), | ||
| playbackmethod: value => Array.isArray(value) && value.every(v => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].indexOf(v) !== -1), |
There was a problem hiding this comment.
don't we also want to use 1 >= v && v <= 11? looks quite clean
| }; | ||
| } | ||
|
|
||
| function addRequestSignals(payload, validBidRequests, bidderRequest) { |
There was a problem hiding this comment.
I can see that this isn't a widely used practice in the repo, but you could type this function using JSDoc:
- https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#param-and-returns
- https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#typedef-callback-and-param
same for constants inside
example: #108 (comment)
| const { gdprConsent, uspConsent } = bidderRequest || {}; | ||
| const userExt = cleanObj({ | ||
| consent: gdprConsent?.consentString, | ||
| eids: deepAccess(validBidRequests[0], 'userIdAsEids') |
There was a problem hiding this comment.
is it safe to read only the first element of this array, is rest the same?
There was a problem hiding this comment.
Yes, it's safe. Every bid in validBidRequests comes from the same bidder request, and core gives them all the same eids value.
| return banner; | ||
| return { | ||
| ...sizeTupleToRtbSize([ | ||
| parseInt(sizes[0][0], 10), |
There was a problem hiding this comment.
I think this deep array access looks a bit unreadable, could you provide proper typing for the tuple and then destructure it to a named constants?
ex.:
/**
* @typedef {[width: number|string, height: number|string]} MediakeysBannerSize
*/
/**
* @typedef {Object} MediakeysBannerBid
* @property {{banner: {sizes: Array<MediakeysBannerSize>}}} mediaTypes
* @property {{adUnit?: string, pos?: number}} [params]
*/
/**
* Returns an openRtb 2.5 banner object, or undefined when the ad unit has no banner sizes.
*
* @param {MediakeysBannerBid} bid Prebid bid object from request
* @returns {object}
*/
function createBannerImp(bid) {
// ...
const [width, height] = sizes[0];
return {
...sizeTupleToRtbSize([parseInt(width, 10), parseInt(height, 10)]),
// ...
}
}| const computedParams = Array.isArray(playerSize) | ||
| ? parseGPTSingleSizeArrayToRtbSize(Array.isArray(playerSize[0]) ? playerSize[0] : playerSize) || {} | ||
| : {}; |
There was a problem hiding this comment.
can be split to improve a readability a bit
| const computedParams = Array.isArray(playerSize) | |
| ? parseGPTSingleSizeArrayToRtbSize(Array.isArray(playerSize[0]) ? playerSize[0] : playerSize) || {} | |
| : {}; | |
| const [size] = Array.isArray(playerSize?.[0]) ? playerSize : [playerSize]; | |
| const computedParams = parseGPTSingleSizeArrayToRtbSize(size) || {}; |
Co-authored-by: Bartłomiej Wąś <63346093+KT-Trez@users.noreply.github.com>

Type of change
Bugfix
Feature
New bidder adapter
Updated bidder adapter
Code style update (formatting, local variables)
Refactoring (no functional changes, no api changes)
Build related changes
CI related changes
Does this change affect user-facing APIs or examples documented on http://prebid.org?
Other
Description of change
Add new oRTB signals according to new oRTB format specification
Be sure to test the integration with your adserver using the Hello World sample page. -->
Other information