The Media API
One of the complaints about using plug-ins to display audio and video is that they are dumb elements on the page; you can’t interact unless the plug-in specifically makes itself available. The HTML5 media elements, however, have the big advantage of an extensive API that allows you access to information about the media file and makes interacting simple. You access the API through a set of interfaces: Each media element has shared properties and methods in the
HTMLMediaElement interface; audio also has the unique
HTMLAudioElement interface; and video has
The first two methods I’ll introduce have obvious functions: They are
pause(), and are simply applied to the media element. Given unique controls on ...