Assigned
Status Update
Comments
sn...@google.com <sn...@google.com> #2
Hi, thanks for reaching out to us and reporting this issue! Will share this to the internal teams and open a report on your behalf. Will reach back with updates as soon as I have one.
Thanks!
lu...@gmail.com <lu...@gmail.com> #3
This has created significant limitations in our app - we need to enable COEP so we can use SharedArrayBuffer for some performance-intensive code, however we currently can't do this and embed YouTube videos at the same time, which we need to support. Credentialless/anonymous iframes would theoretically also solve this issue, but this is not widely adopted in browsers (and WebKit is in fact resistant to implementing it due to user safety concerns: https://github.com/WebKit/standards-positions/issues/45 )
Description
Description
When embedding the YouTube player in a website with Cross-Origin Embedder Policy (COEP) enabled, the player fails to render because www.youtube.com site is not sending the Cross-Origin-Embedder-Policy header.
How to repoduce
For example, let's use the HTML code returned by YouTube itself to embed this video :
Let's say this HTML code is served from a server with COEP enabled using this header:
Cross-Origin-Embedder-Policy: require-corp
When loading this page with Google Chrome the YouTube player fails to render. If you check the Google Chrome's Issue tab in Development tool there's an issue on the request to the YouTube server:
See attached screenshot.
Expected result
YouTube player renders.
Is it 100% reproducible?
Yes, when server uses
Cross-Origin-Embedder-Policy: require-corp
it is always reproducible.Proposed solution
Adding the following header to the response from YouTube fixes the issue:
Cross-Origin-Embedder-Policy: require-corp
This has been tested using a Chrome extension that is able to alter Response headers.