MediaSourceInterface
https://dom.spec.whatwg.org/#interface-eventtarget
Extends
Properties
activeSourceBuffers
readonly
activeSourceBuffers:SourceBufferList
For additional information, see https://www.w3.org/TR/media-source-2/#dom-mediasource-activesourcebuffers.
duration
duration:
number
For additional information, see https://www.w3.org/TR/media-source-2/#dom-mediasource-duration.
onsourceclose
onsourceclose:
EventListener
For additional information, see https://www.w3.org/TR/media-source-2/#dom-mediasource-onsourceclose
onsourceended
onsourceended:
EventListener
For additional information, see https://www.w3.org/TR/media-source-2/#dom-mediasource-onsourceended
onsourceopen
onsourceopen:
EventListener
For additional information, see https://www.w3.org/TR/media-source-2/#dom-mediasource-onsourceopen
readyState
readonly
readyState:ReadyState
For additional information, see https://www.w3.org/TR/media-source-2/#dom-mediasource-readystate.
sourceBuffers
readonly
sourceBuffers:SourceBufferList
For additional information, see https://www.w3.org/TR/media-source-2/#dom-mediasource-sourcebuffers.
Methods
addEventListener()
addEventListener(
type
,listener
,options
?):void
Adds an event listener.
Parameters
type
string
The event to listen to.
listener
The Event Handler function.
options?
Ignore.
boolean |
AddEventListenerOptions |
Returns
void
Inherited from
addSourceBuffer()
addSourceBuffer(
type
):SourceBuffer
For additional information, see https://www.w3.org/TR/media-source-2/#dom-mediasource-addsourcebuffer.
Parameters
type
string
Mime type.
Returns
clearLiveSeekableRange()
clearLiveSeekableRange():
void
For additional information, see https://www.w3.org/TR/media-source-2/#dom-mediasource-clearliveseekablerange.
Returns
void
dispatchEvent()?
optional
dispatchEvent(event
):boolean
Dispatches an event to the target
Parameters
event
The event which signals an occurrenceo.
Returns
boolean
TODO
Add and define in the implementations, keep it optional for now.
Inherited from
endOfStream()
endOfStream(
error
?):void
For additional information, see https://www.w3.org/TR/media-source-2/#dom-mediasource-endofstream.
Parameters
error?
Returns
void
removeEventListener()
removeEventListener(
type
,listener
,options
?):void
Removes an event listener.
Parameters
type
string
The event to listen to.
listener
The Event Handler function to be removed.
options?
Ignore.
boolean |
EventListenerOptions |
Returns
void
Inherited from
EventTarget
.removeEventListener
removeSourceBuffer()
removeSourceBuffer(
sourceBuffer
):void
For additional information, see https://www.w3.org/TR/media-source-2/#dom-mediasource-removesourcebuffer.
Parameters
sourceBuffer
source buffer instance to be removed.
Returns
void
setLiveSeekableRange()
setLiveSeekableRange(
start
,end
):void
For additional information, see https://www.w3.org/TR/media-source-2/#dom-mediasource-setliveseekablerange.
Parameters
start
number
end
number
Returns
void
Last updated: Oct 02, 2025