The MediaRecorder interface of the MediaStream Recording API provides functionality to easily record media. It is created using the MediaRecorder() constructor.

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

See also:

Static methods

Constructor

@:value({ output : 0 })new(node:AudioNode, output:Int = 0, ?options:Null<MediaRecorderOptions>)

new(stream:MediaStream, ?options:Null<MediaRecorderOptions>)

Throws:

null

DOMError

Variables

read onlymimeType:String

Returns the MIME type that was selected as the recording container for the MediaRecorder object when it was created.

read onlystate:RecordingState

Returns the current state of the MediaRecorder object (inactive, recording, or paused.)

read onlystream:MediaStream

Returns the stream that was passed into the constructor when the MediaRecorder was created.

Methods

pause():Void

Pauses the recording of media.

Throws:

null

DOMError

requestData():Void

Requests a Blob containing the saved data received thus far (or since the last time requestData() was called. After calling this method, recording continues, but in a new Blob.

Throws:

null

DOMError

resume():Void

Resumes recording of media after having been paused.

Throws:

null

DOMError

start(?timeSlice:Int):Void

Begins recording media; this method can optionally be passed a timeslice argument with a value in milliseconds. If this is specified, the media will be captured in separate chunks of that duration, rather than the default behavior of recording the media in a single large chunk.

Throws:

null

DOMError

stop():Void

Stops recording, at which point a dataavailable event containing the final Blob of saved data is fired. No more recording occurs.

Throws:

null

DOMError

Inherited Variables

Inherited Methods

Defined by EventTarget

addEventListener(type:String, listener:Function, ?options:EitherType<AddEventListenerOptions, Bool>, ?wantsUntrusted:Bool):Void

addEventListener(type:String, listener:EventListener, ?options:EitherType<AddEventListenerOptions, Bool>, ?wantsUntrusted:Bool):Void

Register an event handler of a specific event type on the EventTarget.

Throws:

null

DOMError

dispatchEvent(event:Event):Bool

Dispatch an event to this EventTarget.

Throws:

null

DOMError

removeEventListener(type:String, listener:Function, ?options:EitherType<EventListenerOptions, Bool>):Void

removeEventListener(type:String, listener:EventListener, ?options:EitherType<EventListenerOptions, Bool>):Void

Removes an event listener from the EventTarget.

Throws:

null

DOMError