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
  • PrintPrint
Share this Page URL
Help

3. Multimedia Hacking > Hack 30. Create Custom Video Controls with Video APIs

Hack 30. Create Custom Video Controls with Video APIs

It’s great that HTML5 video comes with its own controls, but at times they don’t meet the needs of your application. Learn how to use the HTML5 video APIs to create your own controls in JavaScript.

It’s fantastic to have built-in controls in every video element. However, in some cases the default controllers just don’t meet your needs. For those cases, the HTML5 <video> tag provides a rich set of APIs that you can control through JavaScript. These APIs are flexible enough to allow you to build an entirely new set of controls for your video. Let’s look at some of the more relevant controls.

Before building out the JavaScript code, let’s start with some basic markup. We’ll have a video element and a list of buttons below it:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

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

  

Start a Free 10-Day Trial


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