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
idreadonlystringA string containing a 36-character universally unique identifier (UUID) for the object.MediaAttributes.id
devicespublicIndexedDevicesThe devices used for the mediaMediaAttributes.devices
streampublicMediaStreamMedia stream for the mediaMediaAttributes.stream
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
statuspublicUserMediaStatusThe status of the mediaMediaAttributes.status
audioMutedpublicboolean | undefinedCurrent mute state of audio track undefined means there is no such track from the streamMediaAttributes.audioMuted
videoMutedpublicboolean | undefinedCurrent mute state of video track undefined means there is no such track from the streamMediaAttributes.videoMuted
audioInput?publicMediaDeviceInfoLikeAudio input device is used for the audio track from the current streamMediaAttributes.audioInput
videoInput?publicMediaDeviceInfoLikeVideo input device is used for the video track from the current streamMediaAttributes.videoInput

Methods

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


applyConstraints()

applyConstraints(constraints): Promise<void>;

Apply the constraints to the current media

Parameters

ParameterType
constraintsMediaDeviceRequest

Returns

Promise<void>


release()

release(): Promise<void>;

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

Returns

Promise<void>


getConstraints()

getConstraints(): MediaDeviceRequest;

Returns

MediaDeviceRequest


setOriginalConstraints()

setOriginalConstraints(constraints): void;

Parameters

ParameterType
constraintsMediaDeviceRequest

Returns

void


getOriginalConstraints()

getOriginalConstraints(): MediaDeviceRequest;

Returns

MediaDeviceRequest


isAudioInputUnavailable()

isAudioInputUnavailable(): boolean;

Returns

boolean


isVideoInputUnavailable()

isVideoInputUnavailable(): boolean;

Returns

boolean


requestedAudio()

requestedAudio(): boolean;

Returns

boolean


requestedVideo()

requestedVideo(): boolean;

Returns

boolean


getSettings()

getSettings(): MediaSettings;

Returns

MediaSettings


toJSON()

toJSON(): unknown;

Returns

unknown


getTracks()

getTracks(): MediaTrack[];

Returns

MediaTrack[]


getAudioTracks()

getAudioTracks(): MediaTrack[];

Returns

MediaTrack[]


getVideoTracks()

getVideoTracks(): MediaTrack[];

Returns

MediaTrack[]


addTrack()

addTrack(track): void;

Parameters

ParameterType
trackMediaTrack

Returns

void


isCurrentTrack()

isCurrentTrack(track): boolean;

Parameters

ParameterType
trackMediaTrack

Returns

boolean


removeTrack()

removeTrack(track): void;

Parameters

ParameterType
trackMediaTrack

Returns

void


clone()

clone(signals?, label?): Media;

Parameters

ParameterType
signals?MediaSignals
label?string

Returns

Media