I try to embed a YouTube video on my page as soon as the user gives a link to the video.
<iframe width=\'560\' height=\'315\' src='http://www.youtube.com/watch?v=<video id>&output=embed' frameborder=\'0\' allowfullscreen></iframe>
But when I try to add this, I get this error. After checking the page in chrome, I see this error on the console tab
"Failure to display the document due to the fact that the display is prohibited by X-Frame-Options"
I canβt watch videos even in IE and Firefox as well
I even tried to add
header('X-Frame-Options:Allow-From http://www.youtube.com'); header('X-Frame-Options:GOFORIT); &output=embed to the url
After reading certain decisions in other posts.
But I still get the same error.
I also see that youtube has a method of embedding objects for showing videos, but youtube already did this as an old method of embedding videos. So I want to use the new iframe method to embed the video in my page.
The problem is visible in
- Firefox 11
- Chrome 18.0
- IE 8
Has anyone encountered this problem?
javascript html security php
Srikan Mar 29 '12 at 23:15 2012-03-29 23:15
source share