Flash and HTML5 video tag - YouTube position

Original author: John Harding
  • Transfer
A couple of days ago, YouTube posted an interesting post on its blog .

I’ll say from myself that I’ve been watching with interest all this artificially inflated “confrontation” between the Flash platform and HTML5, but I’m sure that the topic interests me not only.

Interestingly, many rush into the fray with arguments like “we want open standards, we don’t want this terrible, disgusting and terribly proprietary Flash, which is also just a plugin!” It is precisely the attention of such people that I want to draw to the fact that "HTML5" (in particular the tag ) is not a silver bullet, and I am a supporter of the point of view that the Great Advent of HTML5 will not solve all the problems at once.

Sooner or later, someone had to indicate an (more or less) objective position on this topic and YouTube did it, and they hopefully at least know something about such things as “video” and “flash”.

So, actually, the translation. Go.

There has been a lot of discussion and debate lately about whether the coveted HTML5 tag will eventually become a replacement for Flash Player to play videos online. We ourselves have long been interested in advances related to HTML. Both the tag and most of the videos on YouTube can already be viewed using our HTML5 player . His work showed us that although the tag is a big step towards open standards, the Adobe Flash platform will continue to play a critical role in delivering video on the Internet.

It is important to understand what exactly a site like YouTube needs from the browser in order for the service to suit both viewers and creators of the video content itself. Here, a little more effort is needed than just pointing the browser to a video file, as a tag with pictures does - in practice, everything turns out to be more complicated than just getting and showing the video. Of course, the tag implements the most necessary basic requirements and the work on fulfilling the rest is in full swing , but in the current state, the tag is not able to take into account all the requirements of YouTube:

Standard video format


First and foremost, we need all browsers to support the standard video format. Users upload to YouTube 24 hours of video every minute , so it’s important to minimize the number of supported formats. Especially if you keep in mind that for each video format you can also make several sizes (360p, 480p, 720p, 1080p). We've been encoding video for YouTube with the H.264 codec since 2007, and we use this codec for both Flash Player and iPhone and Android phones. This allows us to easily run HTML5 video in browsers that support H.264, such as Chrome and Safari.

Concerns about patents and licenses led to the fact that some browsers do not support H.264, and this, in turn, led to the fact that the HTML5 specification does not require support for a standard video format. We believe that the web needs an open format alternative. One that will not only resolve the nuances of licensing, but will also take into account the specific features of video on the web. In this regard, we are interested in the success of the new WebM project . For example, Google, as a contribution to the common good deed, opens the sources of VP8 and shares them with WebM. Google, Mozilla and Opera support WebM and we are already starting to work on making the video available in this format. Adobe also promised support for VP8, the video codec for WebM, in future releases of Flash Player.

Full streaming video


Along with the need for a standard video format, effective and reliable means for actually delivering video to the browser are also needed. Simply telling the browser the desired URL is not enough - this does not allow the user to point directly to the piece of video that interests him . While we are moving towards the placement of feature films and live coverage of events , it becomes very important to have sufficient control over the “buffer” and quality (moreover, “on the fly”).

Flash Player allows you to solve such problems, allowing applications to control the downloading and playback of videos using Actionscript, while using either HTTP or RTMP protocol for streaming video. The HTML5 standard alone does not address any issues related to streaming video protocols, but many third-party organizations are working to improve video over HTTP. We are also starting to put efforts into this and hope to see a single standard in the future.

Content Protection


YouTube is not the owner of the videos that you watch - they are owned by their creators, the authors who control exactly how the videos are distributed through YouTube. For YouTube Rentals , for example, video owners require us to use technology to protect the stream, such as the RTMPE protocol in Flash, to prevent further (illegal) distribution. Without such protection technologies, we could not offer this video here .

Encapsulation and implementation


The ability of Flash Player to combine application code and resources into a kind of secure and effective container is one of the key to the ability to embed YouTube videos in other websites. Site owners must be sure that the content embedded in the page will not be able to receive confidential user information, and we must be sure that all the logic of our player (for features such as “labels”, “annotations”, “advertising”) will be sent together with the video. While HTML5 adds sandboxing and messaging functionality, Flash is the only mechanism most sites are willing to use to embed content from other sites.

Full screen video


HD video asks to be shown in full screen, but this has not historically been possible with pure HTML. Although most browsers have full-screen mode, they do not allow you to activate it using JavaScript, just as they do not allow you to deploy a specific part of the page (for example, a video player) to the full screen. Flash Player in this regard provides a complete and safe solution for playing full-screen video with support for hardware acceleration. Although WebKit recently took a couple of steps to support full-screen mode, this is not enough to play video (more precisely, the ability to display additional content on top of the video).

Access to camera and microphone


Video moves not only in one direction. Every day, thousands of users record videos directly to YouTube from their browsers using webcams, which would not be possible without Flash technology. Access to the camera is also needed for such things as video chat and online broadcasting - it is especially important for mobile phones, because almost any of them has a built-in camera. Flash Player has been offering rich access to the camera and microphone for several years, while HTML5 has just begun .

We are pleased to see such active and enthusiastic discussions about the development of web standards - after all, YouTube depends on improvements in browsers, in turn, to develop video viewing tools for users. While video support in HTML5 will allow us to show our videos on computers and devices that do not support Flash Player, it does not yet meet all our requirements. Today, Adobe Flash is the best platform that suits our requirements, and that is why our main video player is made specifically for Flash.

John Harding, Software Engineer


As you can see, a standard is a standard, but it may not take into account many things, because practice often goes beyond the standards, which happens with HTML5. So you need to consider the problem a little less superficially, and even from the point of view of simple video playback, just take and throw out Flash as it is (as Apple wants it) - it just won’t succeed.

PS And no, I'm not a fan of Flash technology in itself, but just think that this is a regular tool that solves certain problems. Including video playback.

What do Habra-people think about all this?

Also popular now: