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

Player should have a queue that executes on player load #6

Open
mike-chowla opened this issue Jan 29, 2021 · 0 comments
Open

Player should have a queue that executes on player load #6

mike-chowla opened this issue Jan 29, 2021 · 0 comments

Comments

@mike-chowla
Copy link
Collaborator

The documentation today says to use setTimeout() with a 3 second to wait for the outstream player renderer js to load. This is both inefficient and error prone as the renderer js can both load much quicker than 3 seconds and or take longer. There should be que that executes when the player script has loaded similar to how Prebid.js works.

The renderer config would then look something like this:

renderer: {
    url: 'bundle.js',   // URL of the renderer
    render: function (bid) {
        var outsteramPlayer = outstreamPlayer || {};
        outsteramPlayer.que = outstreamPlayer.que || [];

        outsteramPlayer.que.push(function() {

                // Object to configure the behaviour of outstream renderer from HTML page.
                var obj = {
                    width: 640,
                    height: 480,
                    vastTimeout: 5000,
                    maxAllowedVastTagRedirects: 3,
                    allowVpaid: false,
                    autoPlay: true,
                    preload: true,
                    mute: false,
                    adText: 'This is sample adtext.'
                }
                // Call to Global object of renderer.
                // Takes bid, element ID and configuration object as parameters
                outstreamPlayer(bid, 'video1', obj);
        });
    }
}  

This might need a bit of refactoring about the how player works today because the current code has outstreamPlayer() as constructor

@patmmccann patmmccann moved this from Triage to Needs volunteers in Prebid.js Tactical Issues table Jul 18, 2022
@patmmccann patmmccann changed the title Player should have a que that executes on player load Player should have a queue that executes on player load Aug 4, 2022
@patmmccann patmmccann moved this from Needs volunteers to Ready for Dev in Prebid.js Tactical Issues table Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready for Dev
Development

No branches or pull requests

1 participant