The popular video hosting site YouTube has offered limited beta HTML5 viewing capabilities for some time now on their website. HTML5 video playback was limited to Google Chrome and Safari, and only directly available on YouTube after joining the beta channel.
Update: HTML5 is the default on YouTube now. There is no need anymore to join the HMTL5 channel to make HTML5 the default playback technology on the video hosting site. The information below is outdated as HTML5 code is provided automatically by YouTube. An option to use Flash code is not provided anymore. End
Webmasters and Internet users who wanted to embed videos on third party websites had no choice but to embed the Flash player, as there was no option to change the embed code to HTML5 video.
Toliver Jue, a YouTube Software Engineer, revealed that YouTube has created an option to embed HTML5 YouTube videos in websites.
The embed code is currently not available for selection on YouTube, developers and webmasters need to copy, edit and paste the new embed code manually to make use of it.
<iframe class="youtube-player" type="text/html" width="640" height="385" src="https://www.youtube-nocookie.com/embed/VIDEO_ID" frameborder="0">
The VIDEO_ID parameter needs to be replaced with the ID of the Youtube video. To embed the video http://www.youtube.com/watch?v=0ud-pdJh8S8 a webmaster would use the following code:
<iframe class="youtube-player" type="text/html" width="640" height="385" src="https://www.youtube-nocookie.com/embed/0ud-pdJh8S8" frameborder="0">
This returns the following video (great song btw): removed
The new embed code offers several benefits over the standard one. Supported HTML5 video browsers will make use of that technology to present the video, users without a HTML5 capable browser, or an unsupported browser are able to view the video in Flash as usual.
"An additional benefit of the new embed style is that it will eventually allow embeds to work on mobile devices, which typically use a built-in player instead of Flash or HTML5", says Toliver.
The new embed code will sooner or later make its way on YouTube, to replace the current embed code. This is good news for users without Flash. Now if YouTube would only begin to add other HTML5 video capable web browsers to the list of supported browsers.
Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.
We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.
If you like our content, and would like to help, please consider making a contribution:
Ghacks is a technology news blog that was founded in 2005 by Martin Brinkmann. It has since then become one of the most popular tech news sites on the Internet with five authors and regular contributions from freelance writers.