Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

CHAPTER 10: Audio and Video > Audio and Video Examples

Audio and Video Examples

Before we add the audio and video elements to the Grandview Avenue sample app, here are some simple examples that will allow you to get started right away.

Using the <audio> Tag

The use of the <audio> tag is very easy.

Companion Site Reference

Example 10-1: Follow the link below to run this example on the companion site.

http://www.learnhtml5book.com/chapter10/audio.php

Just specify the following tag in your HTML page and that's it; you get audio played through your browser with no plugins or special software. It's as simple as that!

<audio src="media/audio-test-1.m4a" controls="controls" />

This tag includes the controls as a parameter. You can see the results in Figure 10-1.

image

Figure 10-1. The <audio> Tag in Action


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint