videojs / videojs-youtube

YouTube playback technology for Video.js
1.12k stars 548 forks source link

CORS Blocks videos #594

Open audas opened 2 years ago

audas commented 2 years ago

AS the title suggests - can not get any videos to play, only sound.

I have tried setting headers to allow access, useCredentials etc, but nothing is working.

Has anyone got this working since the youtube policy change ? If so can we see a working example?

The examples provided do not work.

Someone mentioned we need to set the origin on the iframe ?

Edit:

I think this has something to do with the new CORS policies from Youtube which the videojs.js team have tried to deal with in regards to their withCredentials and crossorigin.

I have tried

Setting allow access origin headers. using embed urls, setting all variations of withCredentials and cross origins, embedding as video element, updating via videojs(element), setting the player options as an object.

Have tested all variations of http:. https:, //www,youtube, //youtube, on websites with http and https.

This has clearly been an ongoing issue for many people for a long time with the same problem not being answered.