title: Embedding youtube video "Refused to display document because display forbidden by X-Frame-Options"
body: <p>I'm trying to embed a youtube video on to my page once the user gives the link to the video.</p>
  
  <pre><code>&lt;iframe width=\'560\' height=\'315\' src='http://www.youtube.com/watch?v=&lt;video id&gt;&amp;amp;output=embed' frameborder=\'0\' allowfullscreen&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>But when I try to add this I get this error. After inspecting the page in chrome, I see this error in the console tab</p>
  
  <p>"Refused to display document because of the display is forbidden by X-Frame-Options"</p>
  
  <p>I'm not able to see the video even in <code>IE</code> and <code>Firefox</code> also</p>
  
  <p>I even tried adding the </p>
  
  <pre><code> header('X-Frame-Options:Allow-From http://www.youtube.com'); 
   header('X-Frame-Options:GOFORIT);
   &amp;amp;output=embed to the url
  </code></pre>
  
  <p>After reading certain solutions in other posts.</p>
  
  <p>But I still get the same error.</p>
  
  <p>I also see that the youtube has the method of object embedding to show the video, but already youtube has made that as old method of embedding the video. So I want to use the new iframe method of embedding the video on to my page.</p>
  
  <p><strong>Problem is seen in</strong> </p>
  
  <ul>
  <li>Firefox 11</li>
  <li>Chrome 18.0</li>
  <li>IE 8</li>
  </ul>
  
  <p>Anybody faced this problem?</p>