Embed Youtube Videos in Iframes

Using iFrames is the new and better way to embed Youtube videos. Youtube has been providing this option to webmasters for some time, especially those who like embedding youtube videos in articles and blog posts, but how many have actually used it.

Check the embed options below Youtube videos –

youtube iframe code

This is how an embedded video code looks like

 <object width="425" height="344">
<param name="movie" value="http://www.youtube.com/v/kffacxfA7G4?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="https://www.youtube.com/v/kffacxfA7G4?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed>
</object> 

Now the iframe code looks looks like this

<iframe title="YouTube video player" type="text/html" width="425" height="349" src="https://www.youtube.com/embed/kffacxfA7G4" frameborder="0"></iframe> 

Why Use Iframe Embed Codes?

Your viewers will be able to view your embedded video in Flash or HTML5 players, depending on their viewing environment and preferences. HTML5 is the future and if HTML5 isn’t supported by the user, they display Flash. Another futuristic use is that it will finally allow embeds to work on mobile devices, which typically use a built-in player instead of Flash or HTML5.

Do you use iframe codes to embed Youtube videos?

Share with friends

16
Leave a Reply

avatar
14 Comment threads
2 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
13 Comment authors
SonyextasyHenrikTerry DaviesJosh Stauffer Recent comment authors
  Subscribe  
Notify of
hadiqa
hadiqa

hey thanks..how to put adsense in this iframe ?

QuickOnlineTips
QuickOnlineTips

Youtube provides you the option to select iframes when you select embed code options.

Pedro Da Silva
Pedro Da Silva

Thanks for this info.

I think this is great tip because of more and more users accessing sites on their mobile devices.

QuickOnlineTips
QuickOnlineTips

Youtube might make it the default setting if the beta test goes well.

BlogTipss
BlogTipss

I will try Iframes . Thats what I looking for. Great post.

Sunil
Sunil

i will try iframes right now….
will post the updates in sometime….

Sunil
Sunil

i am not getting the iframe option :(

Sunil
Sunil

can anyone tell me where can i find the iframes code ?

Julian
Julian

it is just like Vimeo’s
they set the iframe as default embedding rather than object embedding

Namit Gupta
Namit Gupta

I had several times tried watching YouTube videos in HTML5 player. But never got satisfied. Always encountered with some or the other problem. Is this happening with everyone, is HTML5 player not very stable at this time?

Vibin
Vibin

hey sunil,You can find the iframes code by
Click “embed” below video>click “use iframes embed code”>copy the code>use in your blog post.

Josh Stauffer
Josh Stauffer

I don’t currently use iframes to embed YouTube videos but you make some good points. This is worth considering. Thanks!

Terry Davies
Terry Davies

I like this iframe option very much. very economical.
one issue I have is how to autoplay when using iframe
any suggestions?

Henrik
Henrik

oops x came out as a hyperlink

i meant to say using a href

extasy
extasy

thank you very macht

Sony
Sony

I am not using you tube Iframe usally i just put the embed code in my blog .