-
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
Bug in renderAd for video #10505
Comments
Hi @EskelCz I took a quick look at the If you have properly configured Prebid to use the Video Module please let me know what file to look at in your demo page and I'll see if I can help |
@karimMourra Thanks for checking the demo page, you got the right file and you're correct, I missed the video module configuration. However, I think the bug I'm describing still holds, just based on the data types I described. One function returns an array of adUnits, the second expects a single adUnit object. Regarding the video object configuration, I'm perplexed by the |
@karimMourra; if Lines 529 to 538 in 6d39d8b
otherwise, what should it do? beside the problem in the OP, there's also the issue that the adunit is not necessarily in the global |
@EskelCz you're right, it should access the element in the array; we will fix that. |
@dgirardi I feel like I'm missing part of the conversation. @karimMourra Ok lets take this example: https://github.com/prebid/Prebid.js/blob/master/integrationExamples/videoModule/jwplayer/eventListeners.html There is a
|
Some confusion is justified. Lines 550 to 552 in 5a1ebad
which makes some sense (except for the error message) since video needs a separate player to be set up which Prebid didn't attempt to do. The (relatively) new video module does more player management, and knows how to render, but from my understanding its philosophy is that once an adUnit is configured for it nothing else is needed - the module will take care of everything including rendering. Hence why I'm not sure of the scenario where you'd need to |
The Video Module needs a provider to be listed in the config in order to attach itself to the video player. If the player is not instantiated, it instantiates the video player at this point; the configuration is provided by the publisher in the provider config. You only need to register a provider for every video player instance that you expect to use. If you're using one player for several ad units, you only need to register once. The relationship is 1 to many.
So on your page you have 5 different video player instances ? In that case you would need 5 video providers in your config. You can call If you have 5 video players on the page, then why are you concerned about redundant providers ? 5 video players is a lot of overhead already. The Video Module is meant to do more than render ads: it emits video and media events that publishers can use for analytics or for scheduling ads. It populates the When you see room for improvement, we welcome you to implement features that would help your usecase. It would be helpful to us if you could explain your dynamic usecase a bit more. Are you using JW Player or Video.js ? |
@karimMourra I see, I didn't realize there might be multiple adUnits per player. I was in a mindset of regular banner ads with a simple 1:1 relation. Regarding multiple players, it's probably not going to happen often, but since we're generating our config and adUnits for many different publisher use-cases, I wanted our abstraction to be most versatile and simple to implement. But it's ok, multiple "providers" is workable I guess. Thanks for the clarification. However I still don't understand the rendering flow. We're sending the returned bids to a custom adserver, it returns winning bids and has to somehow trigger the render. For banner ads that is with the |
@EskelCz I fixed the issue you reported regarding the array in #10567 . I also updated the example page in that PR to use |
@karimMourra An html with a javascript tag, I guess what you call an ad tag. I'm testing it with your PR version and there's one more issue though. For some reason the adUnit from |
@EskelCz it seems like you're comparing 2 different ad Units; I can tell because the adUnit's |
@karimMourra Sorry you're right. It triggers the |
We have a folder with example pages for video.js in https://github.com/prebid/Prebid.js/tree/master/integrationExamples/videoModule/videojs perhaps one of these can be useful |
@karimMourra It was a struggle but it works :) Thanks a lot |
@karimMourra Found one additional issue with the video module. When the divId in |
@EskelCz could you open the new issue as a different one to track |
@EskelCz Sure, but I'll leave this one open, since the PR with the fix wasn't merged yet. |
This should have been fixed with #10819 |
Thanks, I'll get back to it later. Meanwhile closing this issue. |
Type of issue
bug
Description
Prebid.js/src/prebid.js
Line 532 in 6d39d8b
On line #532 it does array.filter, which always returns a new Array. Then at #534 it looks for
.video
on that array. Since the variable is calledadUnit
, I would guess it's supposed to take the first index of the array.Steps to reproduce
Set up a video adUnit and have a winning bid.
Test page
https://playground.cpex.cz/combination
Expected results
Call
videoModule.renderBid
and hopefully render something :) Not sure what follows then, I'm in middle of figuring out how to do instream ads.Actual results
ERROR: Error trying to write ad. Ad render call ad id <adId> was prevented from writing to the main document.
Platform details
Mac OS, latest Chrome, Prebid 8.12.9
The text was updated successfully, but these errors were encountered: