Media
Extends
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
active | readonly | 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. | MediaAttributes.active |
id | readonly | string | A string containing a 36-character universally unique identifier (UUID) for the object. | MediaAttributes.id |
devices | public | IndexedDevices | The devices used for the media | MediaAttributes.devices |
stream | public | MediaStream | Media stream for the media | MediaAttributes.stream |
expectedAudioInput? | public | MediaDeviceInfoLike | The audio input device which is expected to be used for the current stream based on the provided constraints | MediaAttributes.expectedAudioInput |
expectedVideoInput? | public | MediaDeviceInfoLike | The video input device which is expected to be used for the current stream based on the provided constraints | MediaAttributes.expectedVideoInput |
status | public | UserMediaStatus | The status of the media | MediaAttributes.status |
audioMuted | public | boolean | undefined | Current mute state of audio track undefined means there is no such track from the stream | MediaAttributes.audioMuted |
videoMuted | public | boolean | undefined | Current mute state of video track undefined means there is no such track from the stream | MediaAttributes.videoMuted |
audioInput? | public | MediaDeviceInfoLike | Audio input device is used for the audio track from the current stream | MediaAttributes.audioInput |
videoInput? | public | MediaDeviceInfoLike | Video input device is used for the video track from the current stream | MediaAttributes.videoInput |
Methods
muteAudio()
muteAudio(mute): void;
mute/unmute the audio track
Parameters
| Parameter | Type |
|---|---|
mute | boolean |
Returns
void
muteVideo()
muteVideo(mute): void;
mute/unmute the video track
Parameters
| Parameter | Type |
|---|---|
mute | boolean |
Returns
void
applyConstraints()
applyConstraints(constraints): Promise<void>;
Apply the constraints to the current media
Parameters
| Parameter | Type |
|---|---|
constraints | MediaDeviceRequest |
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
| Parameter | Type |
|---|---|
constraints | MediaDeviceRequest |
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
toJSON()
toJSON(): unknown;
Returns
unknown
getTracks()
getTracks(): MediaTrack[];
Returns
getAudioTracks()
getAudioTracks(): MediaTrack[];
Returns
getVideoTracks()
getVideoTracks(): MediaTrack[];
Returns
addTrack()
addTrack(track): void;
Parameters
| Parameter | Type |
|---|---|
track | MediaTrack |
Returns
void
isCurrentTrack()
isCurrentTrack(track): boolean;
Parameters
| Parameter | Type |
|---|---|
track | MediaTrack |
Returns
boolean
removeTrack()
removeTrack(track): void;
Parameters
| Parameter | Type |
|---|---|
track | MediaTrack |
Returns
void
clone()
clone(signals?, label?): Media;
Parameters
| Parameter | Type |
|---|---|
signals? | MediaSignals |
label? | string |
Returns
Media