W3cubDocs

/Haxe JavaScript

MediaRecorder

package js.html

extends EventTarget

Available on js

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

staticisTypeSupported(type:String):Bool

Constructor

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.

ondataavailable:Function

onerror:Function

onstart:Function

onstop:Function

onwarning:Function

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

© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/MediaRecorder.html