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

Hls Config #325

Closed
jgoggles opened this issue Feb 7, 2018 · 5 comments
Closed

Hls Config #325

jgoggles opened this issue Feb 7, 2018 · 5 comments

Comments

@jgoggles
Copy link

jgoggles commented Feb 7, 2018

Is it (or would it be) possible to pass configuration to the Hls object as stated in the Hls.js documentation?

@jgoggles jgoggles changed the title HLS Config Hls Config Feb 7, 2018
@cookpete
Copy link
Owner

cookpete commented Feb 8, 2018

As of 1.1.2 you can do:

<ReactPlayer
  url={url}
  config={{
    file: {
      hlsOptions: { 
        // options here
      }
    }
  }}
/>

@jgoggles
Copy link
Author

jgoggles commented Feb 8, 2018

Thank you @cookpete!

david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue Dec 23, 2018
david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue May 23, 2020
@amanpwl92
Copy link

I tried to change the hls configuration to add authorization header but does not seem to work for me.
<ReactPlayer url={url} config={{ file: { forceAudio: true, hlsOptions: { forceHLS: true, debug: false, xhrSetup: function(xhr, url) { xhr.setRequestHeader('Authorization', Bearer ${token}) }, } } }}/>

@tbrent
Copy link

tbrent commented Nov 13, 2020

I don't think this is currently working, at least on 2.6.2. My implementation is identical to @amanpwl92 with no success. Has anyone been able to this to work?

@lucid3v
Copy link

lucid3v commented Dec 16, 2020

I don't think this is currently working, at least on 2.6.2. My implementation is identical to @amanpwl92 with no success. Has anyone been able to this to work?

Something must have changed because the above wasn't working for me either.
I had to change the location of forceHLS (moved it up under file instead of under hlsOptions) and it seems to work now...

config={{ file: { forceHLS: true, hlsOptions: { //forceHLS: true, debug: false, xhrSetup: function (xhr, url) { xhr.setRequestHeader("Authorization", `Bearer ${token}`); },

albanqoku added a commit to albanqoku/react-player that referenced this issue Feb 24, 2021
Webmaster1116 added a commit to Webmaster1116/video-player that referenced this issue May 20, 2021
webmiraclepro added a commit to webmiraclepro/video-player that referenced this issue Sep 9, 2022
philip-luther added a commit to philip-luther/react-player that referenced this issue Nov 22, 2024
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

5 participants