Skip to content
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

Quantcast Bid Adapter: uses video mediatypes to read OpenRTB parameters #6932

Merged
merged 4 commits into from
Jun 8, 2021

Conversation

SleimanJneidi
Copy link
Contributor

Type of change

  • Bugfix
  • Feature
  • New 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

Reads video properties from mediaTypes #6512

@patmmccann patmmccann changed the title qcAdpater, uses vidoe mediatypes to read properties Quantcast Bid Adapter: uses video mediatypes to read properties Jun 3, 2021
@patmmccann patmmccann changed the title Quantcast Bid Adapter: uses video mediatypes to read properties Quantcast Bid Adapter: uses video mediatypes to read OpenRTB parameters Jun 3, 2021
@patmmccann
Copy link
Collaborator

do you want to fallback to your own parameters so you don't break any existing integrations?

video['delivery'] = bid.params.video.delivery;
video['placement'] = bid.params.video.placement;
video['api'] = bid.params.video.api;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not keep this block so either place populates it? I think this is why your tests are failing

@@ -221,7 +225,11 @@ describe('Quantcast adapter', function () {

it('overrides video parameters with parameters from adunit', function() {
setupVideoBidRequest({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test looks good as is, it has two different values for mimes and you're testing the ad unit wins.

video['h'] = bid.mediaTypes.video.playerSize[0][1];
} else {
video['w'] = bid.mediaTypes.video.playerSize[0];
video['h'] = bid.mediaTypes.video.playerSize[1];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may want to check for h and w existing directly as well

@@ -25,30 +25,89 @@ export const storage = getStorageManager(QUANTCAST_VENDOR_ID, BIDDER_CODE);

function makeVideoImp(bid) {
const video = {};

if (bid.params.video) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should mimes also be retrieved from the mediaTypes object?

if (bid.params.video) {
video['mimes'] = bid.params.video.mimes;
}

if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.minduration) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might want to consider using utils.deepAccess for nested parameters.

video['api'] = bid.params.video.api;
}
if (bid.mediaTypes.video.mimes) {

if (bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.mimes) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be grouped with the bid.param.video.mimes above

@SleimanJneidi
Copy link
Contributor Author

@patmmccann could you please have another look

Copy link
Contributor

@dpapworth-qc dpapworth-qc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bit of a nit-pick, but looks good otherwise.

} else {
video['w'] = bid.mediaTypes.video.playerSize[0];
video['h'] = bid.mediaTypes.video.playerSize[1];
for (const prop of VIDEO_PROPS_TO_REMOVE) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bit of a nit-pick - would it make more sense to have an allow list of properties rather than a block list? otherwise the video object on mediaTypes or params could introduce new properties and we wouldn't filter them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ChrisHuie ChrisHuie self-assigned this Jun 8, 2021
Copy link
Contributor

@dpapworth-qc dpapworth-qc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - but needs approval from Prebid. :)

@patmmccann patmmccann merged commit c6ea12a into prebid:master Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants