Module Media.Recorder

Media recorder.

See the MediaStream Recording API.

Enumerations

module Bitrate_mode : sig ... end

Bitrate mode enumeration.

module Recording_state : sig ... end

Recording state enumeration.

Recorder

val is_type_supported : Jstr.t -> bool

is_type_supported t is true if recording to MIME type t is supported.

type init

The type for initialisation objects.

val init : ?⁠type':Jstr.t -> ?⁠audio_bps:int -> ?⁠video_bps:int -> ?⁠bps:int -> ?⁠audio_bitrate_mode:Bitrate_mode.t -> unit -> init

init () is a media recorder initialisation object with given parameters.

type t

The type for MediaRecorder objects.

val create : ?⁠init:init -> Stream.t -> t

create ~init r is a recorder for s. The function raises if the type' of the init object is not supported.

val stream : t -> Stream.t

stream r

val type' : t -> Jstr.t

type' r is the stream's MIME type.

val state : t -> Recording_state.t

state r is the recording state of r.

val video_bps : t -> int

video_bps r is the video encoding bit rate of s.

val audio_bps : t -> int

audio_bps r is the audio encoding bit rate of s.

val audio_bitrate_mode : t -> Bitrate_mode.t

audio_bps r is the audio encoding mode of s.

val start : t -> timeslice_ms:int option -> (unit, Jv.Error.t) Stdlib.result

start r ~timeslice_ms starts r. timeslice_ms indicates the number of milliseconds to record in each blob. If not specified the whole duration is in a single blob, unless request_data is invoked to drive the process.

val stop : t -> unit

stop r stops r.

val pause : t -> unit

pause r pauses r.

val resume : t -> unit

resume r resume r.

val request_data : t -> unit

request_data requests the data of r.

Events

module Ev : sig ... end