Skip to main content

Media

Extends

Properties

PropertyModifierTypeDescriptionInherited from
activereadonlybooleanIndicating whether the media is active A stream is considered active if at least one of its MediaStreamTracks does not have its property MediaStreamTrack.readyState set to ended. Once every track has ended, the stream's active property becomes false.MediaAttributes.active
audioInput?publicMediaDeviceInfoLikeAudio input device is used for the audio track from the current streamMediaAttributes.audioInput
audioMutedpublicundefined | booleanCurrent mute state of audio track undefined means there is no such track from the streamMediaAttributes.audioMuted
devicespublicIndexedDevicesThe devices used for the mediaMediaAttributes.devices
expectedAudioInput?publicMediaDeviceInfoLikeThe audio input device which is expected to be used for the current stream based on the provided constraintsMediaAttributes.expectedAudioInput
expectedVideoInput?publicMediaDeviceInfoLikeThe video input device which is expected to be used for the current stream based on the provided constraintsMediaAttributes.expectedVideoInput
idreadonlystringA string containing a 36-character universally unique identifier (UUID) for the object.MediaAttributes.id
statuspublicUserMediaStatusThe status of the mediaMediaAttributes.status
streampublicMediaStreamMedia stream for the mediaMediaAttributes.stream
videoInput?publicMediaDeviceInfoLikeVideo input device is used for the video track from the current streamMediaAttributes.videoInput
videoMutedpublicundefined | booleanCurrent mute state of video track undefined means there is no such track from the streamMediaAttributes.videoMuted

Methods

addTrack()

addTrack(track): void;

Parameters

ParameterType
trackMediaTrack

Returns

void


applyConstraints()

applyConstraints(constraints): Promise<void>;

Apply the constraints to the current media

Parameters

ParameterType
constraintsMediaDeviceRequest

Returns

Promise<void>


clone()

clone(signals?, label?): Media;

Parameters

ParameterType
signals?MediaSignals
label?string

Returns

Media


getAudioTracks()

getAudioTracks(): MediaTrack[];

Returns

MediaTrack[]


getConstraints()

getConstraints(): MediaDeviceRequest;

Returns

MediaDeviceRequest


getOriginalConstraints()

getOriginalConstraints(): MediaDeviceRequest;

Returns

MediaDeviceRequest


getSettings()

getSettings(): MediaSettings;

Returns

MediaSettings


getTracks()

getTracks(): MediaTrack[];

Returns

MediaTrack[]


getVideoTracks()

getVideoTracks(): MediaTrack[];

Returns

MediaTrack[]


isAudioInputUnavailable()

isAudioInputUnavailable(): boolean;

Returns

boolean


isCurrentTrack()

isCurrentTrack(track): boolean;

Parameters

ParameterType
trackMediaTrack

Returns

boolean


isVideoInputUnavailable()

isVideoInputUnavailable(): boolean;

Returns

boolean


muteAudio()

muteAudio(mute): void;

mute/unmute the audio track

Parameters

ParameterType
muteboolean

Returns

void


muteVideo()

muteVideo(mute): void;

mute/unmute the video track

Parameters

ParameterType
muteboolean

Returns

void


release()

release(): Promise<void>;

Release the media resources, e.g. camera/microphone

Returns

Promise<void>


removeTrack()

removeTrack(track): void;

Parameters

ParameterType
trackMediaTrack

Returns

void


requestedAudio()

requestedAudio(): boolean;

Returns

boolean


requestedVideo()

requestedVideo(): boolean;

Returns

boolean


setOriginalConstraints()

setOriginalConstraints(constraints): void;

Parameters

ParameterType
constraintsMediaDeviceRequest

Returns

void


toJSON()

toJSON(): unknown;

Returns

unknown