This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.
The MediaSource interface represents the source of media data for an HTMLMediaElement object. A MediaSource object can be attached to a HTMLMediaElement to be played in the user agent.
Properties
Inherits properties from its parent interface, EventTarget.
MediaSource.sourceBuffersRead only- Is a
SourceBufferListcontaining... MediaSource.activeSourceBuffersRead only- Is a
SourceBufferListcontaining... MediaSource.readyStateRead only- Is an enumerated values ...
MediaSource.duration- Is an
unrestricted double...
Constructors
MediaSource()Read only- Constructs and returns a
MediaSourceobject with no associated source buffers.
Static methods
MediaSource.isTypeSupported()- Returns a
Booleanvalue indicating if the given MIME type is supported by the specific implementation
Methods
Inherits properties from its parent interface, EventTarget.
MediaSource.addSourceBuffer()- Creates, associates with this
MediaSourceobject, and returns aSourceBufferof the given MIME type. MediaSource.removeSourceBuffer()- Removes the given
SourceBufferfrom the list of buffers associated with thisMediaSourceobject. MediaSource.endOfStream()- Signals the end of the stream, eventually with an error.
Specifications
| Specification | Status | Comment |
|---|---|---|
| Media Source Extensions The definition of 'MediaSource' in that specification. |
Working Draft | Initial definition. |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
| Basic support | 23 | 25.0 (25.0) [1] | 11 [2] | 15 | 8 |
| Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | Not supported | 30 | 25.0 (25.0) [1] | Windows 8.1 | Not supported | Not supported |
[1] Available after switching the about:config preference media.mediasource.enabled to true.
[2] Internet Explorer supports MediaSource only on Windows 8
See also
- Related interfaces:
SourceBufferandSourceBufferList.