MediaTrack
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
expectedInput? | readonly | MediaDeviceInfoLike | The MediaDeviceInfo object representing the device that the track is expected to be connected to. See https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo |
id | readonly | string | A unique identifier for the track same as MediaStreamTrack.id if track is available otherwise it uses the id from the construction or the kind. See MediaTrackInit |
input? | readonly | MediaDeviceInfoLike | The MediaDeviceInfo object representing the device that the track is connected to. See https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo |
kind | readonly | "audioinput" | "videoinput" | - |
label? | readonly | string | - |
muted? | public | boolean | The current mute state of the track. undefined means the track is not available |
previousMediaTrack? | readonly | MediaTrack | - |
source | readonly | MediaTrack | The source track that it is originated from |
stopped? | readonly | boolean | It maps to MediaStreamTrack['readyState'] When true the track's readyState is ended, false means live otherwise the track is not available |
suspended? | readonly | boolean | Indicate that the media has been suspended by the User Agent, and it could happen at any time. undefined means the track is not available |
track? | readonly | MediaStreamTrack | The MediaStreamTrack object representing the track See https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack |
Methods
applyConstraints()
applyConstraints(constraints): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
constraints | InputDeviceConstraint |
Returns
Promise<void>
clone()
clone(signals?, label?): MediaTrack;
Parameters
| Parameter | Type |
|---|---|
signals? | MediaSignals |
label? | string |
Returns
MediaTrack
getConstraints()
getConstraints(): InputDeviceConstraint;
Returns
InputDeviceConstraint
getSettings()
getSettings(): ExtendedMediaTrackSettings;
Returns
mute()
mute(toMute, soft?): void;
Mute the track
Parameters
| Parameter | Type | Description |
|---|---|---|
toMute | boolean | true to mute the track, false to unmute |
soft? | boolean | true to indicate a soft mute i.e. setting the track to NOT enabled false or undefined for default mute |
Returns
void
release()
release(): Promise<void>;
Returns
Promise<void>
toJSON()
toJSON(): unknown;
Returns
unknown