Thursday, August 5, 2010

Embed YouTube vidoes to blog or website with iframe - supports Flash and HTML5

YouTube users may often embed YouTube videos on their blogs or websites. And the embed code they use offered by YouTube is just for Adobe Flash Technology. Just as the code shown below:

<object width="480" height="295">
<param name="movie" value="">
<param name="allowFullScreen" value="true">
<param ame="allowscriptaccess" value="always">
<embed src="" width="480" height="295" allowscriptaccess="never" allowfullscreen="true" wmode="transparent" type="application/x-shockwave-flash"></embed>
Advertisement by Leawo Free Video Accelerator - Watch and download online videos in high speed without buffering:
Watch Hot Hollywood movies for free

Flash is a great technology. Most of our browsers on computers have installed Adobe Flash Player so that we can easily view embedded Flash video on computer via Flash player without any problems.

Things are changed when we are using a mobile phone. The browsers in our mobile phone do not know Flash video and Flash technology. Besides, Flash technology is being replaced by HTML5. Furthermore, more and more new mobile phones begin to support HTML5, not Flash.

Under this situation, YouTube brings out iframe for video embedding, which means that we can now use iframe code to embed HTML5 video to our blogs or websites. So that we can view YouTube videos in both computer and mobile web browsers. The below code is examples using iframe code for YouTube video embedding, which supports both Adobe Flash technology and HTML5:

Example 1:
<iframe class="youtube-player" type="text/html" width="640" height="385" src= frameborder="0">

Example 2:
<iframe src="" width="329" height="190"></iframe>

Example 3:
<iframe type="text/html" width="640" height="385" src="" frameborder="0">
1. These iframe code can automatically analyze what browser you’re using, and display Flash video or HTML5 video to you. For example, if you are using the brower that supports Flash technology, the code will display Flash; if not, the code will display HTML5 video.
2. Currently on YouTube, the new iframe embed code is during testing phase, so it needs to be written by you manually.
3. All the above iframe code work. You can feel free to choose one of them to embed YouTube videos to web page.

In the near future the iframe embed code will be the default code for video embedding for YouTube. By then we shall be able to conveniently view videos on iPad, iPhone and other mobile devices.

Reshipment from YouTube World

Stumble Upon Toolbar


  1. This is a great site. Content was great. Keep it uphtml5 video player

  2. This code is simple and serves many needs. Thank you for the thoughtful review. The main advantage of html5 music playerseems to be for embedding rich media such as audio and video in modern browsers. Although, the structure elements seem to be useful. CSS3 seems to be headed in the right direction, leaving many possibilities for implementation and creativity,