Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News YouTube Switches to HTML5 Video Player

YouTube Switches to HTML5 Video Player

Leia em Português

Lire ce contenu en français

YouTube launched their experimental HTML5 video player in January 2010. After five years of working with other browser vendors and the community, they announced that HTML5 videos are now served by default for certain browsers, casting aside the previous Adobe Flash video player.

In a blog post, YouTube Engineering Manager Richard Leider said that Adaptive Bitrate (ABR) technology support was a key factor to their decision:

Adaptive Bitrate (ABR) streaming is critical for providing a quality video experience for viewers - allowing us to quickly and seamlessly adjust resolution and bitrate in the face of changing network conditions.

The ABR in question is Dynamic Adaptive Streaming over HTTP, known as MPEG-DASH. According to Ross Gardler of Microsoft Open Technologies, MPEG-DASH reduces the need for buffering:

With MPEG-DASH, the video stream will automatically drop to a lower definition when the network becomes congested. This reduces the likelihood of the viewer seeing a "paused" video while the player downloads the next few seconds to play (aka buffering). As network congestion reduces, the video player will in turn return to a higher quality stream.

Indeed, Leider says that "ABR has reduced buffering by more than 50 percent globally and as much as 80 percent on heavily-congested networks." In a 2014 interview, Leider said that "YouTube playback uses DASH on TVs, game consoles, set-top boxes, Chromecast, desktop browsers, mobile web, [and] mobile handsets."

MPEG-DASH playback is available in browsers that support the W3C Media Source Extensions (MSE), which is why the YouTube HTML5 player switch is limited to Chrome, IE 11, Safari 8, and some beta versions of Firefox. According to the specification, MSE "allows JavaScript to dynamically construct media streams for <audio> and <video>. It defines objects that allow JavaScript to pass media segments." Web developers can create their own DASH enabled video players by using the dash.js reference implementation.

Other video providers are at different stages in their HTML5 support. Vimeo switched to a default HTML5 player in January 2014 and Netflix uses an HTML5 video player on IE11 and Safari on Yosemite. Others, like the BBC, have only implemented HTML5 video on platforms like Apple's iOS, where Flash has never been available.

Until now, YouTube let users opt-in to use the HTML5 player as long as the browser supported it. Now, users visiting that page on a compliant browser will see that "the HTML5 player is currently used when possible." This change will dramatically reduce the amount of time the Flash based player is used and moves Flash closer to irrelevance.

YouTube recommends developers use the <iframe> API for embedding videos.

Rate this Article