videojs / videojs-contrib-ads

A Tool for Building Video.js Ad Plugins
http://videojs.github.io/videojs-contrib-ads/
Other
384 stars 257 forks source link

ad not playing in firefox #307

Closed SolmazKh closed 6 years ago

SolmazKh commented 6 years ago

Hello. I have recently upgraded my videojs library along with its plugins including contrib-ads. The ad plays smoothly in chrome but in firefox it gives this error:

VIDEOJS: ERROR: videojs-contrib-ads has not seen a loadstart event 5 seconds after being initialized, but a source is present. This indicates that videojs-contrib-ads was initialized too late. It must be initialized immediately after video.js in the same tick. As a result, some ads will not play and some media events will be incorrect

and it skips to the main video without showing the preroll ad.

How come this was not an error before?! What should I do to fix this?

Update 1: It randomly works fine. However it gives this error: InternalError: too much recursion

incompl commented 6 years ago

This was added in 5.x to avoid a class of errors that was impacting a lot of our ad plugin users.

Here is information on what you need to do to address this issue: https://github.com/videojs/videojs-contrib-ads#important-note-about-initialization

If you post your plugin initialization code, I can help identify what needs to change.

SolmazKh commented 6 years ago

Thanks for the response. I had seen the link you gave but I still can't realize what exactly should I add to the code. Unfortunately I don't have permission to share the code and even If I did I don't think you could understand. It's seprated in multiple files and is a little complicated. I am using the preroll plugin for videojs https://github.com/dirkjanm/videojs-preroll. Shouldn't it be handled in the preroll plugin?!

incompl commented 6 years ago

I looked at videojs-preroll and I wasn't sure what version of videojs-contrib-ads that project was built for. I opened an issue there to clarify. They say it requires videojs-contrib-ads 3.x or newer, so you may want to try it with 3.x, 4.x, and 5.x and see if one of those versions works better with that project.

It's still possible this is fixable just in your integration though. I opened an issue in videojs-preroll that has more information

SolmazKh commented 6 years ago

I tried using your recommendation in https://github.com/dirkjanm/videojs-preroll/issues/29. It works fine. I will leave it at that until they fix this issue. Thanks for your help

incompl commented 6 years ago

Happy to help!