blocked by CORS policy

Access to XMLHttpRequest at ‘https://www.youtube.com/’ from origin ‘http://127.0.0.1:26534’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
www.youtube.com/:1 Failed to load resource: net::ERR_FAILED

Build Android Ios can be used normally
But when compiled into HTML5, I get this error
Is there a way to solve
thanks

This is not a Solar2D related issues. See:

You won’t be able to get that working when running your app locally like that.

Hi thanks for your answer


You won’t be able to get that working when running your app locally like that.

If I put it on the server and open this html5 from another device, will it work properly?


After reading it a few times, I still don’t quite understand the meaning of the webpage.

This function can be used on android and ios
What should I do if I want to use it on HTML5?

thanks

1 Like