I run a webserver divided into two sections: a marketing area, managed by Joomla, and a technical area which is mostly static HTML.

The Joomla expert reported that embedding YouTube videos wasn't working and asked for assistance. I hit "View source" on a Joomla page exhibiting the problem and copied everything into a file in the static area of the site. Th original page shows "Blocked Page. An error occurred during a connection to www.youtube.com." while the copied page worked without problems.

On examination, Joomla is using an iframe with a src attribute pointing to the YouTube video so the actual call to YouTube is made by the browser, not the server.

I have used Firefox's "web developer tools" to compare the request headers of the GET requests passed to YouTube and they are identical. Both receive a 200 response, even though one has a 96 kB payload and the other nothing. The response headers differ in time-stamps and some indecipherable cookie content but are otherwise identical.

I have no explanation for this and don't know how to begin to fix it.

Bad page: https://www.guralp.com/component/sppagebuilder/page/157

Good page: https://www.guralp.com/howtos/vid_test/copy.html

(Note that the HTML returned by these will be slightly different until the browser "accepts cookies" on the bad/Joomla page.)

I'd be very grateful for any suggestions.



1 Answer 1


It's to do with your headers.

The site it is not working on has Cross-Origin-Embedder-Policy set to require-corp.

See this question, though note that solutions such as the credentialless attribute has limited support.

  • Thank-you very much: that's let me solve the problem. I had to change our COEP to "unsafe-none" because YouTube have not set the correct header to allow embedding in a COOP/COEP environment, despite it being on their issue-tracker for over two years!
    – seismofish
    Commented Jul 10 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.