devcshort / react-hls

Simple React component for playing hls/rtmp live streams.
https://www.npmjs.com/package/react-hls-player
MIT License
120 stars 48 forks source link

from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. #1

Closed imshafikul closed 4 years ago

imshafikul commented 5 years ago

I am facing a CORS error when I start streaming Url. I just confused about how to remove the problem. Can you please help over the problem?

devcshort commented 4 years ago

I am facing a CORS error when I start streaming Url. I just confused about how to remove the problem. Can you please help over the problem?

This will depend on the server you are requesting the video from. If it's a server that you've created, then you will need to enable CORS on your server. See how to enable CORS server side

If you don't have access to the server, then you will have to try enabling CORS from the client. There's no guarantee it'll work, as CORS is meant to be enabled by the server. See how to enable CORS client side