vime-js / vime

Customizable, extensible, accessible and framework agnostic media player. Modern alternative to Video.js and Plyr. Supports HTML5, HLS, Dash, YouTube, Vimeo, Dailymotion...
https://vimejs.com
MIT License
2.75k stars 154 forks source link

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

Open xeroticikot opened 2 years ago

xeroticikot commented 2 years ago

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 commented 1 year ago

Was there any fix for this?

vladdancer commented 1 year ago

Have you tried to remove crossOrigin property?