silvermine / videojs-chromecast

MIT License
148 stars 75 forks source link

Can't get videojs-chromecast to load #80

Closed alexhackney closed 4 years ago

alexhackney commented 4 years ago

I'm not a js expert but I think I have this loaded correctly. Compiling with webpack.

import videojs from 'video.js';

require('@silvermine/videojs-chromecast')(videojs);

document.addEventListener('DOMContentLoaded', function() {

    var options = {
       controls: true,
       fluid: true,
       techOrder: [ 'chromecast', 'html5' ],
           plugins: {
            chromecast: {
                preloadWebComponents: true,
                addButtonToControlBar: true,
            },
        }
    };

    var video = videojs('livestream', options).ready(function(){
      var player = this;
      getNextSource(player);
      player.on('ended', function() {
        getNextSource(player);
      });

      player.on('error', function() {
        getNextSource(player);
      });
    });
//Rest of the file
});

Then I'm loading on page with two script calls.

<script src="/js/video.js"></script>
<script type="text/javascript" src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"></script>

Video plays and everything is good but I'm not getting the chromecast button and the built in chromecast option isnt working either.

I can cast from other sites, so I know its not a local issue.

Any help would be appreciated.

jthomerson commented 4 years ago

Hey sory @alexhackney, but I don't see anything that jumps out at me as being wrong. Maybe one of the other developers will see something, but I don't. I'll close the issue for now, but if you're able to create a reproducible codepen, or you have additional info about errors in the console or something, leave a comment.

yucomds commented 3 years ago

@alexhackney do you resolve your problem? I'm in the same truoble.. :-(

alexhackney commented 3 years ago

I did. It's all in the setup. I can share it with you later, just dont have it on this machine.

wkhira commented 3 years ago

@alexhackney Hello Alex, I believe I'm having the same issue. Could you please share how did you manage to solve it?

Impre-visible commented 1 year ago

I did. It's all in the setup. I can share it with you later, just dont have it on this machine.

hey @alexhackney I also have the problem, and like wkhira I still believe you got the answer to this issue, do you have it please ?