The MediaSource interface represents a source of media data for an HTMLMediaElement object. A MediaSource object can be attached to a HTMLMediaElement to be played in the user agent.

Documentation MediaSource by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Constructor

new ()

Throws:

null

DOMError

Variables

read onlyactiveSourceBuffers:SourceBufferList

Returns a SourceBufferList object containing a subset of the SourceBuffer objects contained within SourceBuffers — the list of objects providing the selected video track,  enabled audio tracks, and shown/hidden text tracks.

duration:Float

Gets and sets the duration of the current media being presented.

read onlyreadyState:MediaSourceReadyState

Returns an enum representing the state of the current MediaSource, whether it is not currently attached to a media element (closed), attached and ready to receive SourceBuffer objects (open), or attached but the stream has been ended via MediaSource.endOfStream() (ended.)

read onlysourceBuffers:SourceBufferList

Returns a SourceBufferList object containing the list of SourceBuffer objects associated with this MediaSource.

Methods

addSourceBuffer (type:String):SourceBuffer

Throws:

null

DOMError

endOfStream (?error:MediaSourceEndOfStreamError):Void

Throws:

null

DOMError

removeSourceBuffer (sourceBuffer:SourceBuffer):Void

Throws:

null

DOMError

Static methods

Inherited Variables

Inherited Methods

Defined by EventTarget

addEventListener (type:String, listener:Function, capture:Bool = false):Void

addEventListener (type:String, listener:EventListener, capture:Bool = false, ?wantsUntrusted:Bool):Void

Throws:

null

DOMError

dispatchEvent (event:Event):Bool

Throws:

null

DOMError

removeEventListener (type:String, listener:Function, capture:Bool = false):Void

removeEventListener (type:String, listener:EventListener, capture:Bool = false):Void

Throws:

null

DOMError