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

Initialize videojs-contrib-ads sooner to avoid redispatch issues #29

Open
incompl opened this issue Dec 6, 2017 · 1 comment
Open

Comments

@incompl
Copy link

incompl commented Dec 6, 2017

I'm referring to this part:

videojs('example_video_1', {}, function(){
  var player = this;
  player.preroll({
    src:"advertisement.mp4"
  });
});

This initializes the preroll plugin on player ready, which in turn initializes videojs-contrib-ads.

We have had a lot of bugs where people initialized this way because contrib-ads' redispatch feature is not initialized until player ready, which means a lot of events don't get redispatched up until when then. We've seen people rely on those events for analytics, for example.

Other work may need to be done to support this, but you'll want config to look something like this:

var player = videojs('example_video_1');
player.preroll({
  src:"advertisement.mp4"
});

More information in the videojs-contrib-ads readme

@incompl
Copy link
Author

incompl commented Dec 6, 2017

Additionally, videojs-contrib-ads 5.x logs a warning and fails to play ads if it is initialized late, so this is needed for 5.x support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant