Video in browser load before playing

Hello everyone. I have been using a template node to load and play a video. Most times the video plays and will keep playing but occasionally and more frequently it look like the video starts but dowes not finish loading. It almost looks like it was paused. I'm wondering if I need to wait until file is loaded before playing. Here is a sample of what is in the template node. Can someone help with how to wait for a time or until file is loaded before play is executed?

         <video id="video" width="95%" heigth="95%" video loop="loop"></video>

    (function(scope) {
        // Watch for messages being send to this template node
        scope.$watch('msg', function (msg) {      
            if (msg) {

                var video = document.getElementById('video');
                video.src = msg.payload;



Maybe you should need to check that the msg.payload has the correct content. As it is written, any msg.payload that arrives will trigger

Maybe you have some other msg arriving that can disturb?

Also note that browsers generally no longer allow video's to auto-start unless they are muted or unless the user has interacted with the page before the video starts.


This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.