skip to Main Content

I tried to embed a youtube video in my html code, but it always say that "youtube won’t allow to connect".
Here is my code:
<center><iframe src="https://www.youtube.com/embed/fcPOsBCwyu8" frameborder="0" allowfullscreen></iframe></center>
I have already used this iframe and it worked with the following code:
<center><iframe src="https://www.youtube.com/embed/ciMEdMu2s5U" frameborder="0"></iframe></center>

I saw different videos, but they just said to put the embed. I did that and I haven’t changed anything. It also gave me the following error:
Loading "https://www.youtube.com/watch?v=embed%2FqMJe-ysGx0o&feature=youtu.be" into a frame is prevented by the "X-Frame-Options" directive set to "SAMEORIGIN".

2

Answers


  1. Videos that have this message: Video unavailable, watch on youtube means that the embedding of the video or in the Video Privacy settings, is restricted. It might also be related to a copyright claim on the video.

    Login or Signup to reply.
  2. Loading "https://www.youtube.com/watch?v=embed%2FqMJe-ysGx0o&feature=youtu.be" into a frame is prevented by the "X-Frame-Options" directive set to "SAMEORIGIN"
    

    The error is a response header set by the domain from which you are requesting the resource (youtube.com in your example). They have set the header to SAMEORIGIN in this case, which means that they have disallowed loading of the resource in an iframe outside of their domain. For more information see The X-Frame-Options response header on MDN.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search