Skip to content

MediaCaptureAndStreamsAPI

Types

displayMediaStreamOptions

type displayMediaStreamOptions = {
mutable video?: unknown,
mutable audio?: unknown,
}

Record fields

video
option< unknown >
audio
option< unknown >

doubleRange

type doubleRange = {
mutable max?: float,
mutable min?: float,
}

Record fields

max
option< float >
min
option< float >

mediaDeviceInfo

The MediaDevicesInfo interface contains information that describes a single media input or output device. See MediaDeviceInfo on MDN

type mediaDeviceInfo = {
deviceId: string,
kind: mediaDeviceKind,
label: string,
groupId: string,
}

Record fields

deviceId
string
label
string
groupId
string

Module

There are methods and helpers defined in MediaDeviceInfo .

mediaDeviceKind

type mediaDeviceKind =
| @as("audioinput") Audioinput
| @as("audiooutput") Audiooutput
| @as("videoinput") Videoinput

mediaDevices

Provides access to connected media input devices like cameras and microphones, as well as screen sharing. In essence, it lets you obtain access to any hardware source of media data. See MediaDevices on MDN

type mediaDevices = {}

Module

There are methods and helpers defined in MediaDevices .

mediaStream

A stream of media content. A stream consists of several tracks such as video or audio tracks. Each track is specified as an instance of MediaStreamTrack. See MediaStream on MDN

type mediaStream = {id: string, active: bool}

Record fields

id
string
active
bool

Module

There are methods and helpers defined in MediaStream .

mediaStreamConstraints

type mediaStreamConstraints = {
mutable video?: unknown,
mutable audio?: unknown,
mutable preferCurrentTab?: bool,
mutable peerIdentity?: string,
}

Record fields

video
option< unknown >
audio
option< unknown >
preferCurrentTab
option< bool >
peerIdentity
option< string >

mediaStreamTrack

A single media track within a stream; typically, these are audio or video tracks, but other track types may exist as well. See MediaStreamTrack on MDN

type mediaStreamTrack = {
kind: string,
id: string,
label: string,
mutable enabled: bool,
muted: bool,
readyState: mediaStreamTrackState,
mutable contentHint: string,
}

Record fields

kind
string
id
string
label
string
enabled
bool
muted
bool
contentHint
string

Module

There are methods and helpers defined in MediaStreamTrack .

mediaStreamTrackState

type mediaStreamTrackState =
| @as("ended") Ended
| @as("live") Live

mediaTrackCapabilities

type mediaTrackCapabilities = {
mutable width?: uLongRange,
mutable height?: uLongRange,
mutable aspectRatio?: doubleRange,
mutable frameRate?: doubleRange,
mutable facingMode?: array<string>,
mutable sampleRate?: uLongRange,
mutable sampleSize?: uLongRange,
mutable echoCancellation?: array<bool>,
mutable autoGainControl?: array<bool>,
mutable noiseSuppression?: array<bool>,
mutable channelCount?: uLongRange,
mutable deviceId?: string,
mutable groupId?: string,
mutable backgroundBlur?: array<bool>,
mutable displaySurface?: string,
}

Record fields

width
option< uLongRange >
height
option< uLongRange >
aspectRatio
option< doubleRange >
frameRate
option< doubleRange >
facingMode
option< array< string > >
sampleRate
option< uLongRange >
sampleSize
option< uLongRange >
echoCancellation
option< array< bool > >
autoGainControl
option< array< bool > >
noiseSuppression
option< array< bool > >
channelCount
option< uLongRange >
deviceId
option< string >
groupId
option< string >
backgroundBlur
option< array< bool > >
displaySurface
option< string >

mediaTrackConstraints

type mediaTrackConstraints = {
mutable width?: int,
mutable height?: int,
mutable aspectRatio?: float,
mutable frameRate?: float,
mutable facingMode?: string,
mutable sampleRate?: int,
mutable sampleSize?: int,
mutable echoCancellation?: bool,
mutable autoGainControl?: bool,
mutable noiseSuppression?: bool,
mutable channelCount?: int,
mutable deviceId?: string,
mutable groupId?: string,
mutable backgroundBlur?: bool,
mutable displaySurface?: string,
mutable advanced?: array<mediaTrackConstraintSet>,
}

Record fields

width
option< int >
height
option< int >
aspectRatio
option< float >
frameRate
option< float >
facingMode
option< string >
sampleRate
option< int >
sampleSize
option< int >
echoCancellation
option< bool >
autoGainControl
option< bool >
noiseSuppression
option< bool >
channelCount
option< int >
deviceId
option< string >
groupId
option< string >
backgroundBlur
option< bool >
displaySurface
option< string >
advanced
option< array< mediaTrackConstraintSet > >

mediaTrackConstraintSet

type mediaTrackConstraintSet = {
mutable width?: int,
mutable height?: int,
mutable aspectRatio?: float,
mutable frameRate?: float,
mutable facingMode?: string,
mutable sampleRate?: int,
mutable sampleSize?: int,
mutable echoCancellation?: bool,
mutable autoGainControl?: bool,
mutable noiseSuppression?: bool,
mutable channelCount?: int,
mutable deviceId?: string,
mutable groupId?: string,
mutable backgroundBlur?: bool,
mutable displaySurface?: string,
}

Record fields

width
option< int >
height
option< int >
aspectRatio
option< float >
frameRate
option< float >
facingMode
option< string >
sampleRate
option< int >
sampleSize
option< int >
echoCancellation
option< bool >
autoGainControl
option< bool >
noiseSuppression
option< bool >
channelCount
option< int >
deviceId
option< string >
groupId
option< string >
backgroundBlur
option< bool >
displaySurface
option< string >

mediaTrackSettings

type mediaTrackSettings = {
mutable width?: int,
mutable height?: int,
mutable aspectRatio?: float,
mutable frameRate?: float,
mutable facingMode?: string,
mutable sampleRate?: int,
mutable sampleSize?: int,
mutable echoCancellation?: bool,
mutable autoGainControl?: bool,
mutable noiseSuppression?: bool,
mutable channelCount?: int,
mutable deviceId?: string,
mutable groupId?: string,
mutable backgroundBlur?: bool,
mutable displaySurface?: string,
}

Record fields

width
option< int >
height
option< int >
aspectRatio
option< float >
frameRate
option< float >
facingMode
option< string >
sampleRate
option< int >
sampleSize
option< int >
echoCancellation
option< bool >
autoGainControl
option< bool >
noiseSuppression
option< bool >
channelCount
option< int >
deviceId
option< string >
groupId
option< string >
backgroundBlur
option< bool >
displaySurface
option< string >

mediaTrackSupportedConstraints

type mediaTrackSupportedConstraints = {
mutable width?: bool,
mutable height?: bool,
mutable aspectRatio?: bool,
mutable frameRate?: bool,
mutable facingMode?: bool,
mutable sampleRate?: bool,
mutable sampleSize?: bool,
mutable echoCancellation?: bool,
mutable autoGainControl?: bool,
mutable noiseSuppression?: bool,
mutable channelCount?: bool,
mutable deviceId?: bool,
mutable groupId?: bool,
mutable backgroundBlur?: bool,
mutable displaySurface?: bool,
}

Record fields

width
option< bool >
height
option< bool >
aspectRatio
option< bool >
frameRate
option< bool >
facingMode
option< bool >
sampleRate
option< bool >
sampleSize
option< bool >
echoCancellation
option< bool >
autoGainControl
option< bool >
noiseSuppression
option< bool >
channelCount
option< bool >
deviceId
option< bool >
groupId
option< bool >
backgroundBlur
option< bool >
displaySurface
option< bool >

uLongRange

type uLongRange = {mutable max?: int, mutable min?: int}

Record fields

max
option< int >
min
option< int >