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

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. For more information, see http://videojs.github.io/videojs-contrib-ads/integrator/getting-started.html #505

Open
brunofournies opened this issue Nov 22, 2019 · 1 comment

Comments

@brunofournies
Copy link

HI guys, i'm having trouble to set up the IMA plugin in Videojs (https://github.com/googleads/videojs-ima), I'm still getting the 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. For more information, see http://videojs.github.io/videojs-contrib-ads/integrator/getting-started.html

But the weird thing is that sometimes that error disappear and the ads are showing properly for no reason. This is my html set up:

<!DOCTYPE html>
<html dir="ltr" lang="es-cl">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="SemiColonWeb" />
<link href="https://vjs.zencdn.net/7.6.5/video-js.css" rel="stylesheet">
<link href=https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-ads/6.6.5/videojs-contrib-ads.css rel="stylesheet">
<link href=https://cdnjs.cloudflare.com/ajax/libs/videojs-ima/1.7.0/videojs.ima.css rel="stylesheet">
</head>
<body>
<video id="player" class="video-js vjs-big-play-centered vjs-fluid"  playsinline controls preload="none" data-setup='{}'>
    <source src="{{ urlvideo }}" type="application/x-mpegURL">
    <p class='vjs-no-js'>
        To view this video please enable JavaScript, and consider upgrading to a web browser that
        <a href='https://videojs.com/html5-video-support/' target='_blank'>supports HTML5 video</a>
        </p>
</video>                      
<script src='https://vjs.zencdn.net/7.6.5/video.js'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-ads/6.6.5/videojs-contrib-ads.js"></script>
<script src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-ima/1.7.0/videojs.ima.js"></script>
<script>                        
    var player = videojs('player');
    var options = {
        adTagUrl: 'Adurl'        
        };
        player.ima(options);
        player.on('error', function() {
            player.error(null);
            // Modals are temporary by default. They dispose themselves when they are
            // closed; so, we can create a new one each time the player is paused and
            // not worry about leaving extra nodes hanging around.
            var modal = player.createModal('La cámara sólo funcionará desde las 7 AM hasta las 21 PM, asi ahorramos energía :). Si necesitas otro horario, escríbenos por instagram y hablamos!');
        });
    </script>   
</body>
</html>

Any idea of why im having ths issue?

Thanks guys!

@jszoja
Copy link

jszoja commented Dec 19, 2019

Getting the same problem in Chrome. Replicating regularly when opening first chrome window - new user session.

My HTML:

<video-js ... > 
[...] 
$(function {  // jQuery document.onReady

   var bcplayer = bc("ooyalaplayer");
   // [...]
}
// [...]
<script src="https://service.videoplaza.tv/proxy/pulse-sdk-html5/2.1/latest.min.js"></script>
<script src="https://service.videoplaza.tv/proxy/pulse-sdk-html5-skin/base.min.js"></script>
<script src="https://service.videoplaza.tv/proxy/pulse-sdk-html5-bridges/videojs/3/latest.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-ads/6.6.5/videojs-contrib-ads.min.js"></script>

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

2 participants