Java Reference
In-Depth Information
when complicated operations are being carried out. You can find more information about
them at the Mozilla Developer Network.
Multimedia
Before HTML5 it was notoriously difficult to display audio and video in browsers, and plu-
gins such as Flash often had to be used. HTML5 introduced the <audio> and <video>
tags used to insert audio and video clips into a web page. It also introduced a Media API
for controlling the playback of the clips using JavaScript.
An audio clip can be inserted into a page with the <audio> tag, using the src attribute
to point to the audio file:
<audio src="/song.mp3" controls>
Your browser does not support the audio element.
</audio>
A video clip can be inserted with the <video> tag, using the src attribute to point to the
movie file:
<video src="http://movie.mp4" controls>
Your browser does not support the video element.
</video>
Any content inside the <audio> or <video> tags will only display if the browser does
not support them; hence, it can be used to display a message to users of older browsers
without support for these features. The controls attribute can be added (without any
value) and will display the browser's native controls, such as play, pause, and volume con-
trol, as can be seen in the screenshot in Figure 14.4 .
Search WWH ::




Custom Search