HTML and CSS Reference
In-Depth Information
HTML5 provides a solution for this with the new
<video>
and
<audio>
elements,
which allow supported multimedia files to be played back natively by the browser, with no
third-party plug-ins required. An example is shown in
figure 1.8
.
Figure 1.8. YouTube HTML5 video in action. As you can see from the code in the inspector, the YouTube video in
this screenshot doesn't use the Adobe Flash plug-in but is fully implemented using the HTML5
<video>
element
and related APIs.
The
<video>
and
<audio>
elements both support the
<track>
element, which you
can use to deliver accompanying text content such as subtitles. You can use the
<source>
element to provide a variety of file formats, ensuring that visitors can consume the content,
regardless of what OS or browser they're using.
HTML5 also defines an API with a series of methods for controlling the playback of a
video or audio file. These include methods for playing, pausing, fast-forwarding, rewind-
ing, adjusting the volume, and more. You'll learn about these APIs in detail as you build a
1.3.3. Drag and drop
Lack of drag-and-drop interactivity had been an issue that has plagued web application de-
velopers for a long time. This type of functionality has been prevalent in desktop applica-