package js.html
extends Element › DOMElement › Node › EventTarget
extended by AudioElement, VideoElement
Available on jsThe
HTMLMediaElementinterface adds toHTMLElementthe properties and methods needed to support basic media-related capabilities that are common to audio and video. TheHTMLVideoElementandHTMLAudioElementelements both inherit this interface.Documentation HTMLMediaElement by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See:
read only audioTracks:AudioTrackListIs a AudioTrackList that lists the AudioTrack objects contained in the element.
autoplay:BoolIs a Boolean that reflects the autoplay HTML attribute, indicating whether playback should automatically begin as soon as enough media is available to do so without interruption.
read only buffered:TimeRangesReturns a TimeRanges object that indicates the ranges of the media source that the browser has buffered (if any) at the moment the buffered property is accessed.
controls:BoolIs a Boolean that reflects the controls HTML attribute, indicating whether user interface items for controlling the resource should be displayed.
crossOrigin:StringIs a DOMString indicating the CORS setting for this media element.
read only currentSrc:StringReturns a DOMString with the absolute URL of the chosen media resource.
currentTime:FloatIs a double indicating the current playback time in seconds. Setting this value seeks the media to the new time.
defaultMuted:BoolIs a Boolean that reflects the muted HTML attribute, which indicates whether the media element's audio output should be muted by default.
defaultPlaybackRate:FloatIs a double indicating the default playback rate for the media.
read only duration:FloatReturns a double indicating the length of the media in seconds, or 0 if no media data is available.
read only ended:BoolReturns a Boolean that indicates whether the media element has finished playing.
read only error:MediaErrorReturns a MediaError object for the most recent error, or null if there has not been an error.
loop:BoolIs a Boolean that reflects the loop HTML attribute, which indicates whether the media element should start over when it reaches the end.
muted:BoolIs a Boolean that determines whether audio is muted. true if the audio is muted and false otherwise.
read only networkState:IntReturns a unsigned short (enumeration) indicating the current state of fetching the media over the network.
read only paused:BoolReturns a Boolean that indicates whether the media element is paused.
playbackRate:FloatIs a double that indicates the rate at which the media is being played back.
read only played:TimeRangesReturns a TimeRanges object that contains the ranges of the media source that the browser has played, if any.
preload:StringIs a DOMString that reflects the preload HTML attribute, indicating what data should be preloaded, if any. Possible values are: none, metadata, auto.
read only readyState:IntReturns a unsigned short (enumeration) indicating the readiness state of the media.
read only seekable:TimeRangesReturns a TimeRanges object that contains the time ranges that the user is able to seek to, if any.
read only seeking:BoolReturns a Boolean that indicates whether the media is in the process of seeking to a new position.
src:StringIs a DOMString that reflects the src HTML attribute, which contains the URL of a media resource to use.
srcObject:MediaStreamIs a MediaStream representing the media to play or that has played in the current HTMLMediaElement.
read only textTracks:TextTrackListReturns the list of TextTrack objects contained in the element.
read only videoTracks:VideoTrackListReturns the list of VideoTrack objects contained in the element.
Note: Gecko supports only single track playback, and the parsing of tracks' metadata is only available for media with the Ogg container format.
volume:FloatIs a double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest).
addTextTrack (kind:TextTrackKind, label:String = "", language:String = ""):TextTrackAdds a text track (such as a track for subtitles) to a media element.
canPlayType (type:String):StringDetermines whether the specified media type can be played back.
fastSeek (time:Float):VoidThrows:
null |
DOMError |
|---|
load ():VoidResets the media element and restarts the media resource. Any pending events are discarded. How much media data is fetched is still affected by the preload attribute. This method can be useful for releasing resources after any src attribute and source element descendants have been removed. Otherwise, it is usually unnecessary to use this method, unless required to rescan source element children after dynamic changes.
pause ():VoidThrows:
null |
DOMError |
|---|
play ():VoidThrows:
null |
DOMError |
|---|
static inline read only HAVE_CURRENT_DATA:Int = 2 static inline read only HAVE_ENOUGH_DATA:Int = 4 static inline read only HAVE_FUTURE_DATA:Int = 3 static inline read only HAVE_METADATA:Int = 1 static inline read only HAVE_NOTHING:Int = 0 static inline read only NETWORK_EMPTY:Int = 0 static inline read only NETWORK_IDLE:Int = 1 static inline read only NETWORK_LOADING:Int = 2 static inline read only NETWORK_NO_SOURCE:Int = 3
© 2005–2018 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/MediaElement.html