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

Youtube videos are not loading due to CORS policy. #318

Open
xeroticikot opened this issue Jun 26, 2022 · 2 comments
Open

Youtube videos are not loading due to CORS policy. #318

xeroticikot opened this issue Jun 26, 2022 · 2 comments

Comments

@xeroticikot
Copy link

Local videos are showing just fine. But youtube videos are not loading. Below is the console error.

Access to video at 'https://www.youtube.com/watch?v=F68hWJNujbM' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
www.youtube.com/watch?v=F68hWJNujbM:1          GET https://www.youtube.com/watch?v=F68hWJNujbM net::ERR_FAILED 200

Implementation code given below -

<Player>
    <DefaultUi>
        <Video crossOrigin="{window.location.host}" poster="{poster ? poster : ''}">
            <source data-src="{source}" />
        </Video>
    </DefaultUi>
</Player>
@seenickcode
Copy link

Was there any fix for this?

@vladdancer
Copy link

Have you tried to remove crossOrigin property?

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

3 participants