Monday, June 24, 2013

YouTube's Smarter Video Player

YouTube's Smarter Video Player: YouTube had a feature that allowed you to stop buffering a video. You right-clicked a video, selected "stop download" and YouTube no longer downloaded the video. This was especially useful for paused videos and long videos.

The feature is no longer available. I've tried both the Flash player and the HTML5 player.

The truth is that this feature is no longer needed because buffering stops when you pause a video. Try this: open a random YouTube video, wait a few seconds and then pause the video. Even after 5 minutes, YouTube's progress bar will look the same.

YouTube has a smarter way to download videos that uses adaptive streaming and only downloads what's needed. That's only the case for the Flash player: the HTML5 player works just like before.

Here's what happens when you play a video right now: YouTube downloads a lot of different sized text files that are merged.

The HTML5 player and the old Flash player download a single video file. The new Flash player slices the video and requests each slice separately (the project was referred internally as "sliced bread"). What's the point?

"The new player is keeping close eyes on the speed and health of your internet connection, explained [YouTube's Andy] Berkheimer: 'It's continuously monitoring the bandwidth and the throughput it is seeing,' he said, adding that it also keeps tabs on the size of your player. Are you watching a video in full screen? Then you can expect YouTube to send you more bits, as long as your connection is fast enough. (...) YouTube tends to be more aggressive in sending out higher-quality video, and then scales down the video if necessary, Berkheimer explained. The site also makes use of the fact that you often watch more than one YouTube video in a row, and optimizes your bit rate across an entire session. The results of these efforts have been encouraging. YouTube has seen buffering reduced by 20 percent since it launched adaptive streaming for its desktop player," reported GigaOM.

Adaptive streaming will come to the HTML5 player, then to the mobile players and the TV players. At some point, the settings that allow you to change video quality may disappear because they're no longer needed. Instead of having to adjust the video quality, YouTube could automatically change it for you depending on your connection speed.

Here's a video from Google I/O that offers more technical information about adaptive streaming, a feature that was implemented in 4 years: