Skip to main content

Interface: Media

Hierarchy

Properties

active

Readonly active: boolean

Indicating 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.

Inherited from

MediaAttributes.active


audioInput

Optional audioInput: MediaDeviceInfoLike

Audio input device is used for the audio track from the current stream

Inherited from

MediaAttributes.audioInput


audioMuted

audioMuted: undefined | boolean

Current mute state of audio track undefined means there is no such track from the stream

Inherited from

MediaAttributes.audioMuted


devices

devices: IndexedDevices

The devices used for the media

Inherited from

MediaAttributes.devices


expectedAudioInput

Optional expectedAudioInput: MediaDeviceInfoLike

The audio input device which is expected to be used for the current stream based on the provided constraints

Inherited from

MediaAttributes.expectedAudioInput


expectedVideoInput

Optional expectedVideoInput: MediaDeviceInfoLike

The video input device which is expected to be used for the current stream based on the provided constraints

Inherited from

MediaAttributes.expectedVideoInput


id

Readonly id: string

A string containing a 36-character universally unique identifier (UUID) for the object.

Inherited from

MediaAttributes.id


status

status: UserMediaStatus

The status of the media

Inherited from

MediaAttributes.status


stream

stream: MediaStream

Media stream for the media

Inherited from

MediaAttributes.stream


videoInput

Optional videoInput: MediaDeviceInfoLike

Video input device is used for the video track from the current stream

Inherited from

MediaAttributes.videoInput


videoMuted

videoMuted: undefined | boolean

Current mute state of video track undefined means there is no such track from the stream

Inherited from

MediaAttributes.videoMuted

Methods

addTrack

addTrack(track): void

Parameters

NameType
trackMediaTrack

Returns

void


applyConstraints

applyConstraints(constraints): Promise<void>

Apply the constraints to the current media

Parameters

NameType
constraintsMediaDeviceRequest

Returns

Promise<void>


clone

clone(): Media

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


isVideoInputUnavailable

isVideoInputUnavailable(): boolean

Returns

boolean


muteAudio

muteAudio(mute): void

mute/unmute the audio track

Parameters

NameType
muteboolean

Returns

void


muteVideo

muteVideo(mute): void

mute/unmute the video track

Parameters

NameType
muteboolean

Returns

void


release

release(): Promise<void>

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

Returns

Promise<void>


removeTrack

removeTrack(track): void

Parameters

NameType
trackMediaTrack

Returns

void


requestedAudio

requestedAudio(): boolean

Returns

boolean


requestedVideo

requestedVideo(): boolean

Returns

boolean


setOriginalConstraints

setOriginalConstraints(constraints): void

Parameters

NameType
constraintsMediaDeviceRequest

Returns

void


toJSON

toJSON(): unknown

Returns

unknown