public interface MediaElement extends Element
Modifier and Type | Field and Description |
---|---|
static int |
EOS_DECODE_ERR |
static int |
EOS_NETWORK_ERR |
static int |
EOS_NO_ERROR |
static int |
HAVE_CURRENT_DATA
Data is available for the current playback position, but not enough to actually play more than one frame.
|
static int |
HAVE_ENOUGH_DATA
Enough data is available—and the download rate is high enough—that the media can be played through to the end without interruption.
|
static int |
HAVE_FUTURE_DATA
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).
|
static int |
HAVE_METADATA
Enough of the media resource has been retrieved that the metadata attributes are initialized. Seeking will no longer raise an exception.
|
static int |
HAVE_NOTHING
No information is available about the media resource.
|
static int |
NETWORK_EMPTY |
static int |
NETWORK_IDLE |
static int |
NETWORK_LOADING |
static int |
NETWORK_NO_SOURCE |
static int |
SOURCE_CLOSED |
static int |
SOURCE_ENDED |
static int |
SOURCE_OPEN |
ALLOW_KEYBOARD_INPUT
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Modifier and Type | Method and Description |
---|---|
TextTrack |
addTextTrack(String kind) |
TextTrack |
addTextTrack(String kind,
String label) |
TextTrack |
addTextTrack(String kind,
String label,
String language) |
String |
canPlayType(String type,
String keySystem)
Determines whether the specified media type can be played back.
|
TimeRanges |
getBuffered()
The ranges of the media source that the browser has buffered, if any.
|
MediaController |
getController() |
String |
getCurrentSrc()
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
networkState is EMPTY . |
float |
getCurrentTime()
The current playback time, in seconds. Setting this value seeks the media to the new time.
|
float |
getDefaultPlaybackRate()
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
NOT_SUPPORTED_ERR exception. |
float |
getDuration()
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
NaN . If the media is streamed and has no predefined length, the value is Inf . |
MediaError |
getError()
The media error object for the most recent error, or null if there has not been an error.
|
double |
getInitialTime() |
String |
getMediaGroup() |
int |
getNetworkState()
The current state of fetching the media over the network.
|
EventListener |
getOnwebkitkeyadded() |
EventListener |
getOnwebkitkeyerror() |
EventListener |
getOnwebkitkeymessage() |
EventListener |
getOnwebkitneedkey() |
EventListener |
getOnwebkitsourceclose() |
EventListener |
getOnwebkitsourceended() |
EventListener |
getOnwebkitsourceopen() |
float |
getPlaybackRate()
The current rate at which the media is being played back.
|
TimeRanges |
getPlayed()
The ranges of the media source that the browser has played, if any.
|
String |
getPreload()
Reflects the
preload
HTML attribute, indicating what data should be preloaded at page-load time, if any. |
int |
getReadyState()
The readiness state of the media:
|
TimeRanges |
getSeekable()
The time ranges that the user is able to seek to, if any.
|
String |
getSrc()
Reflects the
src
HTML attribute, containing the URL of a media resource to use. |
float |
getStartTime()
The earliest possible position in the media, in seconds.
|
TextTrackList |
getTextTracks() |
float |
getVolume()
The audio volume, from 0.0 (silent) to 1.0 (loudest).
|
int |
getWebkitAudioDecodedByteCount() |
String |
getWebkitMediaSourceURL() |
int |
getWebkitSourceState() |
int |
getWebkitVideoDecodedByteCount() |
boolean |
isAutoplay()
Reflects the
autoplay
HTML attribute, indicating whether to begin playing as soon as enough media is available. |
boolean |
isControls()
Reflects the
controls
HTML attribute, indicating whether user interface items for controlling the resource should be displayed. |
boolean |
isDefaultMuted()
Reflects the
muted
HTML attribute, indicating whether the media element's audio output should be muted by default. |
boolean |
isEnded()
Indicates whether the media element has ended playback.
|
boolean |
isLoop()
Reflects the
loop
HTML attribute, indicating whether the media element should start over when it reaches the end. |
boolean |
isMuted()
true if the audio is muted, and false otherwise. |
boolean |
isPaused()
Indicates whether the media element is paused.
|
boolean |
isSeeking()
Indicates whether the media is in the process of seeking to a new position.
|
boolean |
isWebkitClosedCaptionsVisible() |
boolean |
isWebkitHasClosedCaptions() |
boolean |
isWebkitPreservesPitch() |
void |
load()
Begins loading the media content from the server.
|
void |
pause()
Pauses the media playback.
|
void |
play()
Begins playback of the media.
|
void |
setAutoplay(boolean arg) |
void |
setController(MediaController arg) |
void |
setControls(boolean arg) |
void |
setCurrentTime(float arg) |
void |
setDefaultMuted(boolean arg) |
void |
setDefaultPlaybackRate(float arg) |
void |
setLoop(boolean arg) |
void |
setMediaGroup(String arg) |
void |
setMuted(boolean arg) |
void |
setOnwebkitkeyadded(EventListener arg) |
void |
setOnwebkitkeyerror(EventListener arg) |
void |
setOnwebkitkeymessage(EventListener arg) |
void |
setOnwebkitneedkey(EventListener arg) |
void |
setOnwebkitsourceclose(EventListener arg) |
void |
setOnwebkitsourceended(EventListener arg) |
void |
setOnwebkitsourceopen(EventListener arg) |
void |
setPlaybackRate(float arg) |
void |
setPreload(String arg) |
void |
setSrc(String arg) |
void |
setVolume(float arg) |
void |
setWebkitClosedCaptionsVisible(boolean arg) |
void |
setWebkitPreservesPitch(boolean arg) |
void |
webkitAddKey(String keySystem,
Uint8Array key) |
void |
webkitAddKey(String keySystem,
Uint8Array key,
Uint8Array initData,
String sessionId) |
void |
webkitCancelKeyRequest(String keySystem,
String sessionId) |
void |
webkitGenerateKeyRequest(String keySystem) |
void |
webkitGenerateKeyRequest(String keySystem,
Uint8Array initData) |
void |
webkitSourceAbort(String id) |
void |
webkitSourceAddId(String id,
String type) |
void |
webkitSourceAppend(String id,
Uint8Array data) |
TimeRanges |
webkitSourceBuffered(String id) |
void |
webkitSourceEndOfStream(int status) |
void |
webkitSourceRemoveId(String id) |
blur, click, focus, getAccessKey, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getBoundingClientRect, getChildElementCount, getChildren, getClassList, getClassName, getClientHeight, getClientLeft, getClientRects, getClientTop, getClientWidth, getContentEditable, getDataset, getDir, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getId, getInnerHTML, getInnerText, getLang, getLastElementChild, getNextElementSibling, getOffsetHeight, getOffsetLeft, getOffsetParent, getOffsetTop, getOffsetWidth, getOnabort, getOnbeforecopy, getOnbeforecut, getOnbeforepaste, getOnblur, getOnchange, getOnclick, getOncontextmenu, getOncopy, getOncut, getOndblclick, getOndrag, getOndragend, getOndragenter, getOndragleave, getOndragover, getOndragstart, getOndrop, getOnerror, getOnfocus, getOninput, getOninvalid, getOnkeydown, getOnkeypress, getOnkeyup, getOnload, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnmousewheel, getOnpaste, getOnreset, getOnscroll, getOnsearch, getOnselect, getOnselectstart, getOnsubmit, getOntouchcancel, getOntouchend, getOntouchmove, getOntouchstart, getOnwebkitfullscreenchange, getOnwebkitfullscreenerror, getOuterHTML, getOuterText, getPreviousElementSibling, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getStyle, getTabIndex, getTagName, getTitle, getWebkitdropzone, getWebkitRegionOverflow, hasAttribute, hasAttributeNS, insertAdjacentElement, insertAdjacentHTML, insertAdjacentText, isContentEditable, isDraggable, isHidden, isSpellcheck, isTranslate, querySelector, querySelectorAll, removeAttribute, removeAttributeNode, removeAttributeNS, scrollByLines, scrollByPages, scrollIntoView, scrollIntoView, scrollIntoViewIfNeeded, scrollIntoViewIfNeeded, setAccessKey, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setClassName, setContentEditable, setDir, setDraggable, setHidden, setId, setInnerHTML, setInnerText, setLang, setOnabort, setOnbeforecopy, setOnbeforecut, setOnbeforepaste, setOnblur, setOnchange, setOnclick, setOncontextmenu, setOncopy, setOncut, setOndblclick, setOndrag, setOndragend, setOndragenter, setOndragleave, setOndragover, setOndragstart, setOndrop, setOnerror, setOnfocus, setOninput, setOninvalid, setOnkeydown, setOnkeypress, setOnkeyup, setOnload, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnmousewheel, setOnpaste, setOnreset, setOnscroll, setOnsearch, setOnselect, setOnselectstart, setOnsubmit, setOntouchcancel, setOntouchend, setOntouchmove, setOntouchstart, setOnwebkitfullscreenchange, setOnwebkitfullscreenerror, setOuterHTML, setOuterText, setScrollLeft, setScrollTop, setSpellcheck, setTabIndex, setTitle, setTranslate, setWebkitdropzone, webkitMatchesSelector, webkitRequestFullscreen, webkitRequestFullScreen
addEventListener, addEventListener, appendChild, cloneNode, compareDocumentPosition, contains, dispatchEvent, getAttributes, getBaseURI, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPreviousSibling, getTextContent, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, removeEventListener, removeEventListener, replaceChild, setNodeValue, setPrefix, setTextContent
static final int EOS_DECODE_ERR
static final int EOS_NETWORK_ERR
static final int EOS_NO_ERROR
static final int HAVE_CURRENT_DATA
static final int HAVE_ENOUGH_DATA
static final int HAVE_FUTURE_DATA
static final int HAVE_METADATA
static final int HAVE_NOTHING
static final int NETWORK_EMPTY
static final int NETWORK_IDLE
static final int NETWORK_LOADING
static final int NETWORK_NO_SOURCE
static final int SOURCE_CLOSED
static final int SOURCE_ENDED
static final int SOURCE_OPEN
boolean isAutoplay()
autoplay
HTML attribute, indicating whether to begin playing as soon as enough media is available.void setAutoplay(boolean arg)
TimeRanges getBuffered()
MediaController getController()
void setController(MediaController arg)
boolean isControls()
controls
HTML attribute, indicating whether user interface items for controlling the resource should be displayed.void setControls(boolean arg)
String getCurrentSrc()
networkState
is EMPTY
.float getCurrentTime()
void setCurrentTime(float arg)
boolean isDefaultMuted()
muted
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).void setDefaultMuted(boolean arg)
float getDefaultPlaybackRate()
NOT_SUPPORTED_ERR
exception.void setDefaultPlaybackRate(float arg)
float getDuration()
NaN
. If the media is streamed and has no predefined length, the value is Inf
.boolean isEnded()
MediaError getError()
double getInitialTime()
boolean isLoop()
loop
HTML attribute, indicating whether the media element should start over when it reaches the end.void setLoop(boolean arg)
String getMediaGroup()
void setMediaGroup(String arg)
boolean isMuted()
true
if the audio is muted, and false
otherwise.void setMuted(boolean arg)
int getNetworkState()
The current state of fetching the media over the network.
Constant | Value | Description |
EMPTY | 0 | There is no data yet. The readyState is also HAVE_NOTHING . |
LOADING | 1 | The media is loading. |
LOADED_METADATA | 2 | The media's metadata has been loaded. |
LOADED_FIRST_FRAME | 3 | The media's first frame has been loaded. |
LOADED | 4 | The media has been fully loaded. |
EventListener getOnwebkitkeyadded()
void setOnwebkitkeyadded(EventListener arg)
EventListener getOnwebkitkeyerror()
void setOnwebkitkeyerror(EventListener arg)
EventListener getOnwebkitkeymessage()
void setOnwebkitkeymessage(EventListener arg)
EventListener getOnwebkitneedkey()
void setOnwebkitneedkey(EventListener arg)
EventListener getOnwebkitsourceclose()
void setOnwebkitsourceclose(EventListener arg)
EventListener getOnwebkitsourceended()
void setOnwebkitsourceended(EventListener arg)
EventListener getOnwebkitsourceopen()
void setOnwebkitsourceopen(EventListener arg)
boolean isPaused()
float getPlaybackRate()
void setPlaybackRate(float arg)
TimeRanges getPlayed()
String getPreload()
preload
HTML attribute, indicating what data should be preloaded at page-load time, if any.void setPreload(String arg)
int getReadyState()
The readiness state of the media:
Constant | Value | Description |
HAVE_NOTHING | 0 | No information is available about the media resource. |
HAVE_METADATA | 1 | Enough of the media resource has been retrieved that the metadata attributes are initialized. Seeking will no longer raise an exception. |
HAVE_CURRENT_DATA | 2 | Data is available for the current playback position, but not enough to actually play more than one frame. |
HAVE_FUTURE_DATA | 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). |
HAVE_ENOUGH_DATA | 4 | Enough data is available—and the download rate is high enough—that the media can be played through to the end without interruption. |
TimeRanges getSeekable()
boolean isSeeking()
String getSrc()
src
HTML attribute, containing the URL of a media resource to use.void setSrc(String arg)
float getStartTime()
TextTrackList getTextTracks()
float getVolume()
void setVolume(float arg)
int getWebkitAudioDecodedByteCount()
boolean isWebkitClosedCaptionsVisible()
void setWebkitClosedCaptionsVisible(boolean arg)
boolean isWebkitHasClosedCaptions()
String getWebkitMediaSourceURL()
boolean isWebkitPreservesPitch()
void setWebkitPreservesPitch(boolean arg)
int getWebkitSourceState()
int getWebkitVideoDecodedByteCount()
String canPlayType(String type, String keySystem)
void load()
void pause()
void play()
void webkitAddKey(String keySystem, Uint8Array key)
void webkitAddKey(String keySystem, Uint8Array key, Uint8Array initData, String sessionId)
void webkitGenerateKeyRequest(String keySystem)
void webkitGenerateKeyRequest(String keySystem, Uint8Array initData)
void webkitSourceAbort(String id)
void webkitSourceAppend(String id, Uint8Array data)
TimeRanges webkitSourceBuffered(String id)
void webkitSourceEndOfStream(int status)
void webkitSourceRemoveId(String id)
Copyright © 2018. All rights reserved.