MediaSource

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.sourceBuffers Read only
Is a SourceBufferList containing...
MediaSource.activeSourceBuffers Read only
Is a SourceBufferList containing...
MediaSource.readyState Read only
Is an enumerated values ...
MediaSource.duration
Is an unrestricted double ...

Constructors

MediaSource() Read only
Constructs and returns a MediaSource object with no associated source buffers.

Static methods

MediaSource.isTypeSupported()
Returns a Boolean value 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 MediaSource object, and returns a SourceBuffer of the given MIME type.
MediaSource.removeSourceBuffer()
Removes the given SourceBuffer from the list of buffers associated with this MediaSource object.
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

Document Tags and Contributors

Contributors to this page: fscholz, realityking, mpizza, gmarty, teoli
Last updated by: fscholz,