Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook

(Nora) #1

Lesson 3: Using the HTMLMediaElement object CHAPTER 11 449


■■tex tTracks Gets a reference to a TextTrackList object that represents the available
text tracks
■■videoTracks Gets a reference to a VideoTrackList object that represents the available
video tracks
■■volume Sets or gets the volume of the audio or video

Subscribing to HTMLMediaElement events


In addition to the methods and properties of HTMLMediaElement, the following is a list of the
events that you can subscribe to.
■■onabort Triggers on abort
■■oncanplay Triggers when a file has been buffered enough to start playing
■■oncanplaythrough Triggers when a file can be played all the way to the end without
pausing for buffering
■■ondurationchange Triggers when the length of the media changes
■■onemptied riggers when an error occurs and the file is suddenly unavailableT
■■onended Triggers when the media has reached the end of the stream
■■onerror riggers when an error occurs as the file is being loadedT
■■onloadeddata Triggers when media data is loaded
■■onloadedmetadata Triggers when metadata such as duration and dimensions are
loaded
■■onloadstart riggers when the file begins to load but before anything is actually T
loaded
■■onpause Triggers when the media is paused
■■onplay Triggers when the media starts playing
■■onplaying Triggers when the media actually has started playing
■■onprogress Triggers when the browser is retrieving the media
■■onratechange Triggers each time the playback rate changes
■■onreadystatechange Triggers each time the ready state changes
■■onseeked Triggers to indicate that seeking has ended
■■onseeking Triggers to indicate that seeking is active
■■onstalled Triggers when the browser is unable to retrieve the media
■■onsuspend Triggers when media retrieval stops prior to being completely loaded
■■ontimeupdate Triggers when the playing position has changed
■■onvolumechange Triggers each time the volume or mute is changed
■■onwaiting Triggers when the media has paused but is expected to resume
Free download pdf