HTMLMediaElement

#include <HTMLMediaElement.idl>

Inherits from HTMLElement, Element, Node, EventTarget

Inherited by HTMLVideoElement

Public Functions

Name
intcohPrebufferKeyframe(double timestamp)
Prebuffers a keyframe for faster seek. Requires exact timestamp of the keyframe. Throws an error on failure.
sequence< double >cohGetKeyframeTimestamps()
Obtains the information for keyframe timestamps from video metadata.
voidload()
CanPlayTypeEnumcanPlayType(DOMString type)
voidplay()
voidpause()

Public Attributes

Name
attribute booleancohFastSeek
A boolean that controls the seek behavior When true the seek requests will seek to the nearest keyframe instead to a specific timepoint, which improves seek performance.
readonly attribute MediaErrorerror
attribute DOMStringsrc
attribute MediaSourcesrcObject
readonly attribute DOMStringcurrentSrc
attribute DOMStringcrossOrigin
const unsigned shortNETWORK_EMPTY
const unsigned shortNETWORK_IDLE
const unsigned shortNETWORK_LOADING
const unsigned shortNETWORK_NO_SOURCE
readonly attribute unsigned shortnetworkState
attribute DOMStringpreload
“none” or “auto” to preload keyframes for better seek performance
readonly attribute TimeRangesbuffered
const unsigned shortHAVE_NOTHING
const unsigned shortHAVE_METADATA
const unsigned shortHAVE_CURRENT_DATA
const unsigned shortHAVE_FUTURE_DATA
const unsigned shortHAVE_ENOUGH_DATA
readonly attribute unsigned shortreadyState
readonly attribute booleanseeking
attribute doublecurrentTime
readonly attribute unrestricted doubleduration
readonly attribute booleanpaused
attribute doubledefaultPlaybackRate
attribute doubleplaybackRate
readonly attribute TimeRangesplayed
readonly attribute TimeRangesseekable
readonly attribute booleanended
attribute booleanautoplay
attribute booleanloop
attribute doublevolume
attribute booleanmuted
attribute EventSetterdurationchange
attribute EventSetteremptied
attribute EventSetterended
attribute EventSettererror
attribute EventSetterloadstart
attribute EventSetterseeked
attribute EventSetterseeking
attribute EventSettertimeupdate
attribute EventSettervolumechange
attribute EventSetterresize

Additional inherited members

Public Functions inherited from HTMLElement

Name
HTMLElementHTMLElement()

Public Attributes inherited from HTMLElement

Name
readonly attribute DOMStringMapdataset
readonly attribute CSSStyleDeclarationstyle
readonly attribute ElementoffsetParent
readonly attribute longoffsetTop
readonly attribute longoffsetLeft
readonly attribute longoffsetWidth
readonly attribute longoffsetHeight

Public Functions inherited from Element

Name
voidsetAttribute(DOMString qualifiedName, DOMString value)
sets the given attribute name to the specified value
voidsetAttributeNS(DOMString ns, DOMString qualifiedName, DOMString value)
sets the given attribute name to the specified value
voidremoveAttribute(DOMString qualifiedName)
removes the specified attribute
voidremoveAttributeNS(DOMString ns, DOMString qualifiedName)
removes the specified attribute
DOMStringgetAttribute(DOMString qualifiedName)
returns the attribute value for the given qualified name
DOMStringgetAttributeNS(DOMString ns, DOMString qualifiedName)
returns the attribute value for the given qualified name
booleanhasAttribute(DOMString qualifiedName)
returns whether the element has an attribute with the given qualified name
booleanhasAttributeNS(DOMString ns, DOMString qualifiedName)
returns whether the element has an attribute with the given qualified name
AttrgetAttributeNode(DOMString qualifiedName)
Returns the specified attribute of the specified element, as an Attr node.
AttrgetAttributeNodeNS(DOMString? namespace, DOMString localName)
Returns the Attr node for the attribute with the given namespace and name.
AttrsetAttributeNode(Attr attr)
Adds a new Attr node to the specified element.
AttrsetAttributeNodeNS(Attr attr)
Adds a new namespaced attribute node to an element.
AttrremoveAttributeNode(Attr attr)
Removes the specified attribute from the current element.
booleanhasAttributes()
Returns Boolean value, indicating if the current element has any attributes or not.
sequenceDOMStringgetAttributeNames()
Must return the qualified names of the attributes in context objects attribute list, in order, and a new list otherwise.
HTMLCollectiongetElementsByTagName(DOMString qualifiedName)
Returns the list of elements with qualified name qualifiedName for context object.
HTMLCollectiongetElementsByTagNameNS(DOMString? namespace, DOMString localName)
Return the list of elements with namespace namespace and local name localName for.
HTMLCollectiongetElementsByClassName(DOMString classNames)
Return the list of elements with class names classNames for context object.
ElementinsertAdjacentElement(DOMString where, Element element)
Inserts a given element node at a given position relative to the element it is invoked upon.
voidinsertAdjacentText(DOMString where, DOMString data)
Inserts a given text node at a given position relative to the element it is invoked upon.
Elementclosest(DOMString selectors)
Returns the closest ancestor of the current element (or the current element itself) which matches the selectors given in parameter. If there isn’t such an ancestor, it returns null.
booleanmatches(DOMString selectors)
Returns true if the element would be selected by the specified selector string; otherwise, returns false.
voidblur()
Removes keyboard focus from this element.
voidfocus()
Gives keyboard focus to this element.
voidinsertAdjacentHTML(DOMString position, DOMString text)
Parses the specified text as HTML or XML and inserts the resulting nodes into the DOM tree at a specified position.
ElementquerySelector(DOMString selectors)
Returns the first element that is a descendant of the element on which it is invoked that matches the specified group of selectors.
NodeListquerySelectorAll(DOMString selectors)
Returns a static (not live) NodeList of all elements descended from the element on which it is invoked that matches the specified group of CSS selectors. (The base element itself is not included, even if it matches.)
sequence< Animation >getAnimations(optional GetAnimationsOptions options)
Returns an array of all the Animation objects that the element has.
MorphAnimationgetBackgroundSVGAnimation()
returns an web animations api alike animation object for the corresponding morphed svg on the background
MorphAnimationgetBorderSVGAnimation()
returns a web animations api alike animation object for the corresponding morphed svg on the border
MorphAnimationgetMaskSVGAnimation()
returns a web animations api alike animation object for the corresponding morphed svg on the mask
DOMRectgetBoundingClientRect()
Returns the bounding rectangle of the element.
voidremove()
Removes node Note: This should be part of the ChildNode interface.

Public Attributes inherited from Element

Name
readonly attribute DOMStringtagName
the element tag
readonly attribute DOMStringprefix
Returns the namespace prefix of the specified element, or null if no prefix is specified.
readonly attribute DOMStringnamespaceURI
Returns the namespace URI of the element, or null if the element is not in a namespace.
readonly attribute DOMStringlocalName
returns the local part of the qualified name of an element.
attribute DOMStringslot
Returns the name of the shadow DOM slot attached to the element. A slot is a placeholder inside a web component that users can fill with their own markup.
attribute DOMStringid
the id of the element
readonly attribute NamedNodeMapattributes
Gets a list of all attributes for the Element.
readonly attribute NodeListchildren
A collection rooted at context object matching only element children. Note: This should be part of the ParentNode interface, which Element implements. Note: The return type should be HTMLCollection.
readonly attribute ElementfirstElementChild
attributes getter must return the first child that is an element, and null otherwise. Note: This should be part of the ParentNode interface, which Element
readonly attribute ElementlastElementChild
attributes getter must return the last child that is an element, and null otherwise. Note: This should be part of the ParentNode interface, which Element
readonly attribute ElementpreviousElementSibling
Returns the Element immediately prior to this node in its parent’s children list, or null if there is no Element in the list prior to this node. Note: This attribute is part of the NonDocumentTypeChildNode interface, which Element implements.
readonly attribute ElementnextElementSibling
Returns the Element immediately following this node in its parent’s children list, or null if there is no Element in the list following this node. Note: This attribute is part of the NonDocumentTypeChildNode interface, which Element implements.
readonly attribute unsigned longchildElementCount
attributes getter must return the number of children of context object that are elements. Note: This should be part of the ParentNode interface, which Element
attribute floatscrollLeft
position of the horizontal scrollbar of the element
attribute floatscrollLeftVW
scrollLeft in VW units The setter converts a given value into PX units based on viewport size
attribute floatscrollLeftVH
scrollLeft in VH units The setter converts a given value into PX units based on viewport size
attribute floatscrollTop
position of the vertical scrollbar of the element
attribute floatscrollTopVW
scrollTop in VW units The setter converts a given value into PX units based on viewport size
attribute floatscrollTopVH
scrollTop in VH units The setter converts a given value into PX units based on viewport size
readonly attribute longscrollWidth
size of the horizontal scrollbar of the element
readonly attribute longscrollWidthVW
scrollWidth converted to VW units
readonly attribute longscrollWidthVH
scrollWidth converted to VH units
readonly attribute longscrollHeight
size of the vertical scrollbar of the element
readonly attribute longscrollHeightVW
scrollHeight converted to VH units
readonly attribute longscrollHeightVH
scrollHeight converted to VH units
attribute DOMStringclassName
all of the classes of the element
readonly attribute DOMTokenListclassList
attribute DOMStringinnerHTML
Gets or sets the contents of the element as HTML.
attribute DOMStringouterHTML
Gets a fragment of HTML or XML that represents the element and its contents.
attribute EventSetterfocusin
attribute EventSetterfocusout
attribute EventSetterabort
attribute EventSetterblur
attribute EventSetterclick
attribute EventSetterdblclick
attribute EventSetterfocus
attribute EventSetterkeydown
attribute EventSetterkeypress
attribute EventSetterkeyup
attribute EventSettermousedown
attribute EventSettermouseover
attribute EventSettermouseout
attribute EventSettermouseenter
attribute EventSettermouseleave
attribute EventSettermousemove
attribute EventSettermouseup
attribute EventSetterinput
attribute EventSetterchange
attribute EventSetterscroll
attribute EventSetterwheel
attribute EventSettertouchstart
attribute EventSettertouchend
attribute EventSettertouchmove
attribute EventSetteranimationstart
attribute EventSetteranimationend
attribute EventSetteranimationcancel
attribute EventSetteranimationiteration
attribute EventSettertransitionstart
attribute EventSettertransitionend
attribute EventSettertransitioncancel
attribute EventSettertransitionrun

Public Functions inherited from Node

Name
NoderemoveChild(Node oldChild)
remove a child node
NodeappendChild(Node newChild)
append a node as a child
NodereplaceChild(Node newChild, Node oldChild)
replace oldChild with newChild
NodeinsertBefore(Node node, Node? referenceNode)
insert a node before the reference node, as a child of the current node
NodecloneNode(optional boolean deep =false)
booleanisEqualNode(Node? otherNode)
booleanisSameNode(Node? otherNode)
booleanhasChildNodes()
booleancontains(Node? other)
DOMStringlookupPrefix(DOMString? namespace)
booleanisDefaultNamespace(DOMString? namespace)
voidnormalize()
unsigned shortcompareDocumentPosition(Node other)
NodegetRootNode(optional GetRootNodeOptions options)
DOMStringlookupNamespaceURI(DOMString? prefix)

Public Attributes inherited from Node

Name
const unsigned shortELEMENT_NODE
const unsigned shortATTRIBUTE_NODE
const unsigned shortTEXT_NODE
const unsigned shortCDATA_SECTION_NODE
const unsigned shortENTITY_REFERENCE_NODE
const unsigned shortENTITY_NODE
const unsigned shortPROCESSING_INSTRUCTION_NODE
const unsigned shortCOMMENT_NODE
const unsigned shortDOCUMENT_NODE
const unsigned shortDOCUMENT_TYPE_NODE
const unsigned shortDOCUMENT_FRAGMENT_NODE
const unsigned shortNOTATION_NODE
const unsigned shortDOCUMENT_POSITION_DISCONNECTED
const unsigned shortDOCUMENT_POSITION_PRECEDING
const unsigned shortDOCUMENT_POSITION_FOLLOWING
const unsigned shortDOCUMENT_POSITION_CONTAINS
const unsigned shortDOCUMENT_POSITION_CONTAINED_BY
const unsigned shortDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
readonly attribute DOMStringnodeName
attribute DOMStringnodeValue
attribute DOMStringtextContent
readonly attribute unsigned shortnodeType
type of the node
readonly attribute NodeparentNode
parent of the node
readonly attribute ElementparentElement
parent element of the node. If parent is not an Element, returns null.
readonly attribute NodeListchildNodes
list of the children of this node
readonly attribute NodefirstChild
the node’s first child in the tree, or null if the node is childless
readonly attribute NodelastChild
last child of the node, or null if there are no child elements
readonly attribute NodepreviousSibling
the node immediately preceding the specified one in its parent’s children, or null if the specified node is the first in that list
readonly attribute NodenextSibling
the node immediately following the specified one in its parent’s children, or null if the specified node is the last node in that list
readonly attribute DocumentownerDocument
The Document object associated with this node. This is also the Document object used to create new nodes. When this node is a Document or a DocumentType which is not used with any Document yet, this is null.
readonly attribute USVStringbaseURI
readonly attribute booleanisConnected

Public Functions inherited from EventTarget

Name
voidaddEventListener(DOMInternedString type, EventListener listener, optional boolean useCapture)
voidremoveEventListener(DOMInternedString type, EventListener listener, optional boolean useCapture)
booleandispatchEvent(Event event)

Public Functions Documentation

function cohPrebufferKeyframe

int cohPrebufferKeyframe(
    double timestamp
)

Prebuffers a keyframe for faster seek. Requires exact timestamp of the keyframe. Throws an error on failure.

Parameters:

  • timestamp timestamp of the keyframe in seconds

Return: a positive id if successful or negative value on failure

Note: Can only be used for videos containing metadata with keyframe information, support for partial requests and after readystate is greater than 1 (HAVE_METADATA)

function cohGetKeyframeTimestamps

sequence< double > cohGetKeyframeTimestamps()

Obtains the information for keyframe timestamps from video metadata.

Return: an array with keyframe timestamps in seconds

Note: Can only be used after readystate is greater than 1 (HAVE_METADATA)

function load

void load()

function canPlayType

CanPlayTypeEnum canPlayType(
    DOMString type
)

function play

void play()

function pause

void pause()

Public Attributes Documentation

variable cohFastSeek

attribute boolean cohFastSeek;

A boolean that controls the seek behavior When true the seek requests will seek to the nearest keyframe instead to a specific timepoint, which improves seek performance.

Note: When enabled, currentTime property will report the adjusted time, instead of the time previously set

variable error

readonly attribute MediaError error;

variable src

attribute DOMString src;

variable srcObject

attribute MediaSource srcObject;

variable currentSrc

readonly attribute DOMString currentSrc;

variable crossOrigin

attribute DOMString crossOrigin;

variable NETWORK_EMPTY

const unsigned short NETWORK_EMPTY = 0;

variable NETWORK_IDLE

const unsigned short NETWORK_IDLE = 1;

variable NETWORK_LOADING

const unsigned short NETWORK_LOADING = 2;

variable NETWORK_NO_SOURCE

const unsigned short NETWORK_NO_SOURCE = 3;

variable networkState

readonly attribute unsigned short networkState;

variable preload

attribute DOMString preload;

“none” or “auto” to preload keyframes for better seek performance

variable buffered

readonly attribute TimeRanges buffered;

variable HAVE_NOTHING

const unsigned short HAVE_NOTHING = 0;

variable HAVE_METADATA

const unsigned short HAVE_METADATA = 1;

variable HAVE_CURRENT_DATA

const unsigned short HAVE_CURRENT_DATA = 2;

variable HAVE_FUTURE_DATA

const unsigned short HAVE_FUTURE_DATA = 3;

variable HAVE_ENOUGH_DATA

const unsigned short HAVE_ENOUGH_DATA = 4;

variable readyState

readonly attribute unsigned short readyState;

variable seeking

readonly attribute boolean seeking;

variable currentTime

attribute double currentTime;

variable duration

readonly attribute unrestricted double duration;

variable paused

readonly attribute boolean paused;

variable defaultPlaybackRate

attribute double defaultPlaybackRate;

variable playbackRate

attribute double playbackRate;

variable played

readonly attribute TimeRanges played;

variable seekable

readonly attribute TimeRanges seekable;

variable ended

readonly attribute boolean ended;

variable autoplay

attribute boolean autoplay;

variable loop

attribute boolean loop;

variable volume

attribute double volume;

variable muted

attribute boolean muted;

variable durationchange

attribute EventSetter durationchange;

variable emptied

attribute EventSetter emptied;

variable ended

attribute EventSetter ended;

variable error

attribute EventSetter error;

variable loadstart

attribute EventSetter loadstart;

variable seeked

attribute EventSetter seeked;

variable seeking

attribute EventSetter seeking;

variable timeupdate

attribute EventSetter timeupdate;

variable volumechange

attribute EventSetter volumechange;

variable resize

attribute EventSetter resize;