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

allow publisher to define backup renderer #5638

Merged
merged 19 commits into from
Sep 10, 2020
Merged

allow publisher to define backup renderer #5638

merged 19 commits into from
Sep 10, 2020

Conversation

patmmccann
Copy link
Collaborator

@patmmccann patmmccann commented Aug 20, 2020

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

Publishers will be able to set an ad unit renderer to be "backup only" like this

pbjs.addAdUnit({ code: 'video1', mediaTypes: { video: { context: 'outstream', playerSize: [640, 480] } }, renderer: { url: 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js', backupOnly: true, render: function (bid) { ANOutstreamVideo.renderAd({ targetId: bid.adUnitCode, adResponse: bid.adResponse, }); } }, ... });

Other information

Solves for #1924 , #2668, and #5375

@patmmccann
Copy link
Collaborator Author

@mike-chowla I think this works, How does it look?

@patmmccann
Copy link
Collaborator Author

I put in #5639 to delete the bad adapter test this failed on Safari 12

@mike-chowla
Copy link
Contributor

When I have both an ad unit renderer and bidder supplied renderer, backupOnly isn't working for me because the renderer object renderer object that gets created off of the bid, doesn't get the backupOnly flag set and thus the ad unit renderer is always used:

bidObject.renderer = Renderer.install({ url: adUnitRenderer.url });

@patmmccann
Copy link
Collaborator Author

patmmccann commented Aug 24, 2020 via email

@mike-chowla
Copy link
Contributor

The PR relies on renderer.adUnitCode being set to determine which renderer to use but that code which is outside the PR does not set that field when using bidder supplied renderer

@patmmccann
Copy link
Collaborator Author

This is ready for another look @mike-chowla ; thanks!

Copy link
Contributor

@mike-chowla mike-chowla left a comment

Choose a reason for hiding this comment

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

LGTM

@mike-chowla mike-chowla added the needs 2nd review Core module updates require two approvals from the core team label Aug 31, 2020
@patmmccann
Copy link
Collaborator Author

Fyi @jaiminpanchal27 ; this modifies logic you added in #3284

@bretg
Copy link
Collaborator

bretg commented Sep 2, 2020

docs PR prebid/prebid.github.io#2290

@patmmccann
Copy link
Collaborator Author

closed docs pr and reopened as prebid/prebid.github.io#2303

@ncolletti ncolletti merged commit 466b49e into prebid:master Sep 10, 2020
@ncolletti ncolletti added LGTM and removed needs 2nd review Core module updates require two approvals from the core team labels Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants