HTML media elements (such as
) expose the
interface which provides special properties and methods (beyond the regular element
object interface they also have available to them by inheritance) for manipulating the layout and presentation of media elements.
Data is available for the current playback position, but not enough to actually play more than one frame.
Enough data is available—and the download rate is high enough—that the media can be played through to the end without interruption.
Data for the current playback position as well as for at least a little bit of time into the future is available (in other words, at least two frames of video, for example).
Enough of the media resource has been retrieved that the metadata attributes are initialized. Seeking will no longer raise an exception.
No information is available about the media resource.
HTML attribute, indicating whether to begin playing as soon as enough media is available.
The ranges of the media source that the browser has buffered, if any.
HTML attribute, indicating whether user interface items for controlling the resource should be displayed.
The absolute URL of the chosen media resource (if, for example, the server selects a media file based on the resolution of the user's display), or an empty string if the
The current playback time, in seconds. Setting this value seeks the media to the new time.
HTML attribute, indicating whether the media element's audio output should be muted by default. Changing the value dynamically will not unmute the audio (it only controls the default state).
The default playback rate for the media. The Ogg backend does not support this. 1.0 is "normal speed," values lower than 1.0 make the media play slower than normal, higher values make it play faster. The value 0.0 is invalid and throws a
The length of the media in seconds, or zero if no media data is available. If the media data is available but the length is unknown, this value is
. If the media is streamed and has no predefined length, the value is
Indicates whether the media element has ended playback.
The media error object for the most recent error, or null if there has not been an error.
HTML attribute, indicating whether the media element should start over when it reaches the end.
if the audio is muted, and
The current state of fetching the media over the network.
|0||There is no data yet. The |
readyState is also
|1||The media is loading.|
|2||The media's metadata has been loaded.|
|3||The media's first frame has been loaded.|
|4||The media has been fully loaded.|
Indicates whether the media element is paused.
The current rate at which the media is being played back. This is used to implement user controls for fast forward, slow motion, and so forth. The normal playback rate is multiplied by this value to obtain the current rate, so a value of 1.0 indicates normal speed. Not supported by the Ogg backend.
The ranges of the media source that the browser has played, if any.
HTML attribute, indicating what data should be preloaded at page-load time, if any.
The readiness state of the media:
|0||No information is available about the media resource.|
|1||Enough of the media resource has been retrieved that the metadata attributes are initialized. Seeking will no longer raise an exception.|
|2||Data is available for the current playback position, but not enough to actually play more than one frame.|
|3||Data for the current playback position as well as for at least a little bit of time into the future is available (in other words, at least two frames of video, for example).|
|4||Enough data is available—and the download rate is high enough—that the media can be played through to the end without interruption.|
The time ranges that the user is able to seek to, if any.
Indicates whether the media is in the process of seeking to a new position.
HTML attribute, containing the URL of a media resource to use.
The earliest possible position in the media, in seconds.
The audio volume, from 0.0 (silent) to 1.0 (loudest).
Determines whether the specified media type can be played back.
Begins loading the media content from the server.
Pauses the media playback.
Begins playback of the media. If you have changed the src
attribute of the media element since the page was loaded, you must call load() before play(), otherwise the original media plays again.