📜 ⬆️ ⬇️

Flash and HTML5 “video” tag - YouTube position

A couple of days ago, YouTube posted an interesting post on its blog.

I’ll say from myself that lately I have been watching with interest all this artificially fanned "confrontation" of the Flash platform and HTML5, but I am sure that the topic is of interest not only for me.

Interestingly, many rush into battle with arguments like “we want open standards, we don’t want this terrible, disgusting and terribly proprietary Flash, which is also just a plug-in!”. It is precisely the attention of such people that I want to draw to the fact that “HTML5” (in particular, the <video> ) is not a silver bullet, and I support the view that the Great Advent of HTML5 will not solve all problems at once.
')
Sooner or later, someone had to designate (more or less) an objective position on this topic and that was done by YouTube, and they, let's hope, at least understand something in such things as “video” and “flash”.

So, Actually, the translation. Go.

Recently, there have been a lot of discussions and debates about whether the desired HTML5 <video> tag will eventually replace the Flash Player for playing videos online. We ourselves have long been interested in the progress associated with HTML And the <video> , and most of the videos on YouTube can already be viewed using our HTML5 player . His work showed us that although the <video> is a big step toward 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 such a site like YouTube needs from a browser in order for the service to suit both viewers and creators of the video content itself. It requires a little more effort than just pointing the browser to a video file, as the <img> with pictures does — in practice, everything is more complicated than just getting and showing the video. Of course, the <video> implements the most necessary basic requirements and the work on the implementation of the rest is in full swing, but in the current state the <video> -tag is not able to accommodate all YouTube requirements:

Standard video format


First and foremost, we need all browsers to support the standard video format. Users upload to YouTube for 24 hours of video every minute , so it is 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 have been encoding the video for YouTube with the H.264 codec since 2007, and we use this codec for both Flash Player and iPhone and Android mobile phones. This allows us to easily launch HTML5 videos in browsers that support H.264, for example, in Chrome and Safari.

Concerns about patents and licenses have resulted in some browsers not supporting H.264, and this, in turn, has led to the fact that the HTML5 specification does not require support for a standard video format. We believe that the web needs an alternative in the form of an open format. This one, which will not only resolve the licensing nuances, but will also take into account the specific features of the 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 a common good deed, opens the source code for VP8 and shares it 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, a video codec for WebM, in future releases of Flash Player.

Full streaming video


Along with the need for a standard video format, we also need efficient and reliable means for actually delivering video to the browser. Simply specifying the required URL to the browser is not enough - it does not allow the user to point directly to a piece of video that interests him . While we are moving toward the placement of full-length films and coverage of events on the air , it becomes very important to have sufficient control over the "buffer" and quality (and, moreover, on the fly).

Flash Player allows you to solve such issues by allowing applications to manage the download and playback of video themselves using Actionscript, while using either HTTP or the RTMP protocol for streaming video. The HTML5 standard does not in itself address any problems associated with streaming video protocols, but many independent organizations are working to improve the transmission of video over HTTP. We, too, are beginning to make efforts and hope to see a single standard in the future.

Content protection


YouTube is not the owner of those 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 technology from us to protect the stream, such as Flash's RTMPE protocol, 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 such a secure and efficient container is one of the key features in the ability to embed YouTube videos on 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 historically this was not possible with pure HTML. Although most browsers have full-screen mode, they do not allow activating it with JavaScript, just as they do not allow you to expand a certain part of the page to full screen (for example, a video player). Flash Player in this regard provides a complete and secure solution for playing full-screen video with hardware acceleration support. Although WebKit recently completed a couple of steps to support full-screen mode, this is not enough to play the video (more precisely, the ability to show additional content over the video).

Access to the 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 be impossible without Flash technology. Access to the camera is also needed for such things as video chat and online broadcasting - especially important for mobile phones, because almost every one of them has a built-in camera. Flash Player has been offering rich access to the camera and microphone for several years, while HTML5 is still just beginning .

We are glad to see such active and enthusiastic discussions about the development of web standards - because YouTube depends on improvements in browsers in order to develop video browsers for users. While supporting HTML5 video 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 fits our requirements, and that is why our main video player is made exactly on Flash.

John Harding Software Engineer


As you can see, a standard is a standard, but it may not take many things into account, because the 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 simply playing a video, just take and throw Flash as it is (as Apple wants it) —it won't be so easy.

PS And no, I'm not a fan of Flash technology by itself, but I just think that this is an ordinary tool that solves certain tasks. Including video playback.

What do Habra-people think about all this?

Source: https://habr.com/ru/post/97915/


All Articles