8

So, when I try to run this on my demo site, this is just a blank spot in my webpage. It is not showing youtube or any site I connect it to.

<iframe width="640" height="1400" frameborder="0" 
src="http://www.youtube.com/" name="iFrameSearch">
</iframe>

Is there a way to get this working without using the Youtube API? I would strongly prefer not to use the API quite yet.

  • You code works fine in my chrome. What browser are you using? – SaturnsEye Sep 05 '13 at 10:04
  • I am using chrome as well. I also forgot to list another part of important information! I am using this to show search data. Basically, I have a search bar that is supposed to look on youtube and display the results in the iFrame I am having a problem displaying. –  Sep 05 '13 at 10:17
  • There's your problem then. Post all of the relevant code or create a JSFiddle – SaturnsEye Sep 05 '13 at 10:23
  • 1
    add X-Frame-Options: SAMEORIGIN in your header. – Chinmay235 Sep 05 '13 at 10:26
  • Here is the related code at JSFiddle: http://jsfiddle.net/XgJjg/ –  Sep 05 '13 at 10:29
  • @DouglasHarding Did you find the solution? Please share.. – Mr_Green May 15 '14 at 09:31
  • I never found a solution for it, I just ended up creating my own database of video links. –  May 15 '14 at 18:50

3 Answers3

8

I encountered this problem today, and my problem was HTTP vs HTTPS.

If your page is HTTPS, it will not load the iFrame if it is referencing a un-secure, HTTP site.

Try changing your iFrame to always be HTTPS.

See Insecure content in iframe on secure page for more info.

<iframe width="640" height="1400" frameborder="0" 
src="https://www.youtube.com/" name="iFrameSearch">
</iframe>
Community
  • 1
  • 1
Luke Shaheen
  • 4,262
  • 12
  • 52
  • 82
0

You can try this instead, works very well for me.

<embed
width="420" height="345"
src="http://www.youtube.com/v/XGSy3_Czz8k"
type="application/x-shockwave-flash">
</embed>
Pooja
  • 170
  • 1
  • 1
  • 10
  • Sadly, an embedding will not work with what I am trying to achieve. I updated the issue with more details, because I realized I wasn't as specific as I should have been, my apologies. –  Sep 05 '13 at 10:23
-3
<iframe width="640" height="1400" src="http://www.youtube.com/embed/oHg5SJYRHA0?autoplay=1" frameborder="0" allowfullscreen></iframe>     

Refer this.

Community
  • 1
  • 1
chinna_82
  • 6,353
  • 17
  • 79
  • 134