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 11: Pushing the Limits with Audio and Video

Chapter 11

Pushing the Limits with
Audio and Video

Audio and video are two of the most difficult topics to cover in the mobile web. While each one individually can do a lot to enhance the visual and audible appeal of a site or application, more often than not both technologies end up being abused by mobile content creators. For example, one form of abuse I have noticed becoming more common in the mobile world is audio based advertisements targeted toward mobile browsers. While both audio and video technologies can be used incorrectly or just in a regular plain old annoying manner, they do serve wonderful purposes when used correctly.

Let’s say, for instance, that we’re working on a mobile gaming application and we want to add some relaxing loop of background music to enhance our user’s experience. We can use the built-in HTML5 capabilities of the Android operating system’s browser to do this fairly easily, with only a few lines of code, when using the audio tag. On top of that, we can even use a little bit of JavaScript to manipulate that audio element as well. We can do things such as play, stop, or pause the audio on the press of a button.


  

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