Closed dzhen19 closed 2 years ago
You can add the CORS headers to Icecast by modifying the your server's configuration file. It's described here in the documentation for Icecast: https://www.icecast.org/docs/icecast-trunk/config_file/#http-headers
If you want ICY metadata, you'll also need to add the headers described here in the docs for this library: https://github.com/eshaz/icecast-metadata-js#cors
@eshaz Hello! Thank you for your information. I've edited my icecast2 config file as above to get ogg metadata, however, I still get CORS errors in the browser. In this case, what should I do to solve this problem? I run my icecast2 on a VPS, my website is on Github Pages.
What's the CORS error that you're seeing? The error will tell you the CORS policy that that is blocking your request. You then need to update the policy in your server to unblock that, but what you change depends on the details of the error.
Oooh! I'm terribly sorry, I forgot to add the port number in the audio source, so I got 404 all the time. It was my own fault.😂Thank you again for your patience and instructions! Have a good day(or night)!
Hey @eshaz! This isn't really a problem relating to the library but how do you set up the Access-Control-Allow-Headers on the icecast server?
Thanks!