MediaSource extension type

The MediaSource interface of the Media Source Extensions API 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.


API documentation sourced from MDN Web Docs.

on
Implemented types
Available extensions

Constructors

MediaSource()
factory

Properties

activeSourceBuffers SourceBufferList
The activeSourceBuffers read-only property of the MediaSource interface returns a SourceBufferList object containing a subset of the SourceBuffer objects contained within MediaSource.sourceBuffers — the list of objects providing the selected video track, enabled audio tracks, and shown/hidden text tracks.
no setter
duration double
The duration property of the MediaSource interface gets and sets the duration of the current media being presented.
getter/setter pair
handle MediaSourceHandle
The handle read-only property of the MediaSource interface returns a MediaSourceHandle object, a proxy for the MediaSource that can be transferred from a dedicated worker back to the main thread and attached to a media element via its HTMLMediaElement.srcObject property.
no setter
hashCode int
The hash code for this object.
no setterinherited
onsourceclose EventHandler?
getter/setter pair
onsourceended EventHandler?
getter/setter pair
onsourceopen EventHandler?
getter/setter pair
readyState ReadyState
The readyState read-only property of the MediaSource interface returns an enum representing the state of the current MediaSource. The three possible values are:
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sourceBuffers SourceBufferList
The sourceBuffers read-only property of the MediaSource interface returns a SourceBufferList object containing the list of SourceBuffer objects associated with this MediaSource.
no setter

Methods

addEventListener(String type, EventListener? callback, [JSAny options]) → void
The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
inherited
addSourceBuffer(String type) SourceBuffer
The addSourceBuffer() method of the MediaSource interface creates a new SourceBuffer of the given and adds it to the MediaSource's MediaSource.sourceBuffers list. The new SourceBuffer is also returned.
clearLiveSeekableRange() → void
The clearLiveSeekableRange() method of the MediaSource interface clears a seekable range previously set with a call to MediaSource.setLiveSeekableRange.
dispatchEvent(Event event) bool
The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
inherited
endOfStream([EndOfStreamError error]) → void
The endOfStream() method of the MediaSource interface signals the end of the stream.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeEventListener(String type, EventListener? callback, [JSAny options]) → void
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
inherited
removeSourceBuffer(SourceBuffer sourceBuffer) → void
The removeSourceBuffer() method of the MediaSource interface removes the given SourceBuffer from the SourceBufferList associated with this MediaSource object.
setLiveSeekableRange(num start, num end) → void
The setLiveSeekableRange() method of the MediaSource interface sets the range that the user can seek to in the media element.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

canConstructInDedicatedWorker bool
The canConstructInDedicatedWorker static property of the MediaSource interface returns true if MediaSource worker support is implemented, providing a low-latency feature detection mechanism.
no setter

Static Methods

isTypeSupported(String type) bool
The MediaSource.isTypeSupported() static method returns a boolean value which is true if the given MIME type and (optional) codec are likely to be supported by the current .