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

Renderer Global Variable not set at the time of the render function #5601

Closed
marcDigiteka opened this issue Aug 13, 2020 · 3 comments
Closed
Labels

Comments

@marcDigiteka
Copy link

Type of issue

BUG

Description

Since 3.21 and the change on Renderer.js, if you need a specific renderer for outstream video bids, this Renderer is actually called a bit later than before and the global variable might not be set at the time of the render function.

I did a workaround wit an eventListener on the adUnit and a dispatch at the end of my Renderer.
renderer: { url: 'renderer.js', render: function (bid) { window.addEventListener('dtkRendererReady', function (event) { DtkRenderer.renderVideoAd(bid); }) } }

import DtkRenderer from './library/dtkrenderer/DtkRenderer'; window.DtkRenderer = DtkRenderer; const evt = new Event('dtkRendererReady'); window.dispatchEvent(evt);

What would you do in my shoes ?

@mike-chowla
Copy link
Contributor

My understanding is that there's never been a guarantee that the renderer url is loaded before the render function is called. So I don't know if I'd call this a bug, in sense in operates as it always has and how the original developer intended. It's more of a sub-optimal design choice about how have always renderers work.

I think of the AppNexus bidder and the reference implementation for how to implement an outstream renderer (since the Prebid core support for outstream was likely implemented done by the same engineer (or at least in close coordination with) who implemented the bidder piece. The AppNexus bidder uses queue to handle the issue:

// push to render queue because ANOutstreamVideo may not be loaded yet

The way outstream renderers are handled needs an overhaul for a bunch of reasons including this one.

@patmmccann
Copy link
Collaborator

interestingly an example of the queue is documented here as well https://docs.prebid.org/dev-docs/bidders/prebidServer.html

@stale
Copy link

stale bot commented Sep 5, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 5, 2020
@stale stale bot closed this as completed Sep 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants