I add a YouTube video to the training slides I made by Prismic. It shows the first video but from the second to the end, it returns the following error (on Chrome):
Refused to display 'https://www.youtube.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
On the Firefox, instead of the video plays, the following error shows:
To protect your security, www.youtube.com will not allow Firefox to display the page if another site has embedded it.
and let me click on a button that opens the link of the YouTube video and plays the video on the YouTube channel instead of my website. Is there any suggestion to fix the error?
I believe this is not an issue from the Prismic side. The reason for this is that Google is sending an "X-Frame-Options: SAMEORIGIN" response header. This option prevents the browser from displaying iFrames not hosted on the same domain as the parent page.
I believe, You must ensure the URL contains embed rather than watch as the /embed endpoint allows outside requests, whereas the /watch endpoint does not.
The solution should logically work, but it doesn’t. I did all the suggestions and solutions available on the other websites and none of them work.
The videos are available to embed and the embed link is copied from YouTube that contains ‘embed’.