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

Error when using with videojs 8.6.0 #90

Open
cbarburescu opened this issue Oct 24, 2023 · 1 comment
Open

Error when using with videojs 8.6.0 #90

cbarburescu opened this issue Oct 24, 2023 · 1 comment

Comments

@cbarburescu
Copy link

cbarburescu commented Oct 24, 2023

Hi,

I've tested videojs-http-source-selector v1.1.6 with videojs-contrib-quality-levels v4.0.0 and video.js v8.6.0, but I get this error:

image

My code looks like this:

<head>
  <link href="https://unpkg.com/video.js@8.6.0/dist/video-js.min.css" rel="stylesheet">
  <script src="https://unpkg.com/video.js@8.6.0/dist/video.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-quality-levels/4.0.0/videojs-contrib-quality-levels.min.js" integrity="sha512-3Jrm6nQebMfkSWFmpC12Nhzn1R87CfrzCXJfhvTxmEyml05sUr3Fw37Aiazh1Fo9HKuYEzi0oluFjBvdOW8aPQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
  <script src="https://unpkg.com/videojs-http-source-selector@1.1.6/dist/videojs-http-source-selector.min.js"></script>
  <!-- If you'd like to support IE8 (for Video.js versions prior to v7) -->
  <!-- <script src="https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script> -->
</head>

<body>
  <video
    id="player"
    class="video-js"
    width="720"
    height="400"
  >
  </video>

  <script>
    videojs.Vhs.xhr.beforeRequest = function(options) {
      if (options.headers == undefined){
        options.headers = {}
      }
      options.headers["Custom-Header"] = "Custom"
    
      return options;
    };

    var options = 
    {
      controls: true,
      preload: 'auto',
      plugins: {
        httpSourceSelector:
        {
          default: 'auto'
        }
      }
    }

    var url = 'https://my.streaming.url/encrypted-slug';
    var player = videojs('player', options);
    player.httpSourceSelector();
    player.src({ type: "application/x-mpegurl", src: url });

  </script>

</body>

Could anyone help with this?

Thank you!

@OzetAkademi
Copy link

Hey there,

we have rewritten this plugin, to be compatible with videojs 8.0 and up. you can get it from our public repository.

https://github.com/OzetAkademi/videojs-http-source-selector 1.1.7

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