@pexip/media 20.3.4 → 20.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/api-docs/README.mdx +404 -0
- package/api-docs/enumerations/DeniedDevices.mdx +7 -0
- package/api-docs/enumerations/UserMediaStatus.mdx +49 -0
- package/api-docs/functions/applyContentHint.mdx +33 -0
- package/api-docs/functions/createAudioMixingProcess.mdx +20 -0
- package/api-docs/functions/createAudioStreamProcess.mdx +15 -0
- package/api-docs/functions/createGetDisplayMedia.mdx +26 -0
- package/api-docs/functions/createMedia.mdx +20 -0
- package/api-docs/functions/createMediaSignal.mdx +42 -0
- package/api-docs/functions/createMediaSignals.mdx +33 -0
- package/api-docs/functions/createPreviewStreamController.mdx +13 -0
- package/api-docs/functions/createVideoStreamProcess.mdx +13 -0
- package/api-docs/functions/deriveInitialPermissionStatus.mdx +14 -0
- package/api-docs/functions/getPermissionStatus.mdx +34 -0
- package/api-docs/functions/isAnalyzerNodeInitProp.mdx +13 -0
- package/api-docs/functions/isAudioContentHint.mdx +13 -0
- package/api-docs/functions/isMedia.mdx +13 -0
- package/api-docs/functions/isNonNullObject.mdx +13 -0
- package/api-docs/functions/isUserMediaStatus.mdx +13 -0
- package/api-docs/functions/isVideoContentHint.mdx +13 -0
- package/api-docs/functions/isVideoStreamTrackProcessorAPIs.mdx +13 -0
- package/api-docs/functions/setLogger.mdx +13 -0
- package/api-docs/functions/toDeniedDevices.mdx +13 -0
- package/api-docs/interfaces/AudioDetectionSignals.mdx +6 -0
- package/api-docs/interfaces/AudioSignalDetectionOptions.mdx +6 -0
- package/api-docs/interfaces/DenoiseParams.mdx +9 -0
- package/api-docs/interfaces/ExtendedMediaTrackSettings.mdx +38 -0
- package/api-docs/interfaces/Media.mdx +316 -0
- package/api-docs/interfaces/MediaAttributes.mdx +19 -0
- package/api-docs/interfaces/MediaChangesSignals.mdx +15 -0
- package/api-docs/interfaces/MediaController.mdx +11 -0
- package/api-docs/interfaces/MediaInit.mdx +14 -0
- package/api-docs/interfaces/MediaOptions.mdx +10 -0
- package/api-docs/interfaces/MediaProps.mdx +9 -0
- package/api-docs/interfaces/MediaSettings.mdx +6 -0
- package/api-docs/interfaces/MediaTrack.mdx +121 -0
- package/api-docs/interfaces/MediaTrackInit.mdx +29 -0
- package/api-docs/interfaces/PreviewControllerProps.mdx +14 -0
- package/api-docs/interfaces/PreviewEventHandler.mdx +19 -0
- package/api-docs/interfaces/PreviewStreamController.mdx +350 -0
- package/api-docs/interfaces/PreviewStreamParams.mdx +15 -0
- package/api-docs/interfaces/VoiceActivityDetectionOptions.mdx +6 -0
- package/api-docs/type-aliases/AudioContentHint.mdx +3 -0
- package/api-docs/type-aliases/CreatePreviewStreamController.mdx +3 -0
- package/api-docs/type-aliases/ExtendedMediaTrackSettingsKey.mdx +3 -0
- package/api-docs/type-aliases/GeneratedMediaSignals.mdx +9 -0
- package/api-docs/type-aliases/GetDisplayMedia.mdx +3 -0
- package/api-docs/type-aliases/GetUserMediaProcess.mdx +19 -0
- package/api-docs/type-aliases/MediaSignals.mdx +3 -0
- package/api-docs/type-aliases/MediaSignalsOptional.mdx +3 -0
- package/api-docs/type-aliases/MediaSignalsRequired.mdx +3 -0
- package/api-docs/type-aliases/PreviewInput.mdx +3 -0
- package/api-docs/type-aliases/Process.mdx +19 -0
- package/api-docs/type-aliases/Segmenters.mdx +3 -0
- package/api-docs/type-aliases/TrackProcessor.mdx +3 -0
- package/api-docs/type-aliases/Unsubscribe.mdx +7 -0
- package/api-docs/type-aliases/UserMediaValidator.mdx +13 -0
- package/api-docs/type-aliases/VideoContentHint.mdx +3 -0
- package/api-docs/type-aliases/VideoRenderParams.mdx +15 -0
- package/api-docs/type-aliases/VideoStreamTrackProcessorAPIs.mdx +7 -0
- package/api-docs/variables/AUDIO_CONTENT_HINTS.mdx +17 -0
- package/api-docs/variables/REQUIRED_SIGNAL_KEYS.mdx +3 -0
- package/api-docs/variables/VIDEO_CONTENT_HINTS.mdx +17 -0
- package/api-docs/variables/areBothGranted.mdx +3 -0
- package/api-docs/variables/hasNoAudioDevices.mdx +3 -0
- package/api-docs/variables/hasNoDevice.mdx +3 -0
- package/api-docs/variables/hasNoVideoDevices.mdx +3 -0
- package/api-docs/variables/internalSignals.mdx +13 -0
- package/api-docs/variables/isAudioDeviceInUse.mdx +3 -0
- package/api-docs/variables/isDeviceInUse.mdx +3 -0
- package/api-docs/variables/isDevicesInUse.mdx +3 -0
- package/api-docs/variables/isFallback.mdx +3 -0
- package/api-docs/variables/isFallbackAudio.mdx +3 -0
- package/api-docs/variables/isFallbackVideo.mdx +3 -0
- package/api-docs/variables/isGranted.mdx +3 -0
- package/api-docs/variables/isGrantedAudio.mdx +3 -0
- package/api-docs/variables/isGrantedOnlyAudio.mdx +3 -0
- package/api-docs/variables/isGrantedOnlyAudioNoVideoDevices.mdx +3 -0
- package/api-docs/variables/isGrantedOnlyVideo.mdx +3 -0
- package/api-docs/variables/isGrantedOnlyVideoNoAudioDevices.mdx +3 -0
- package/api-docs/variables/isGrantedVideo.mdx +3 -0
- package/api-docs/variables/isInitial.mdx +3 -0
- package/api-docs/variables/isInitialPermissions.mdx +3 -0
- package/api-docs/variables/isInitialPermissionsGranted.mdx +3 -0
- package/api-docs/variables/isInitialPermissionsNotGranted.mdx +3 -0
- package/api-docs/variables/isOnlyAudioError.mdx +3 -0
- package/api-docs/variables/isOnlyVideoError.mdx +3 -0
- package/api-docs/variables/isOverConstrained.mdx +3 -0
- package/api-docs/variables/isPromptAudio.mdx +3 -0
- package/api-docs/variables/isPromptVideo.mdx +3 -0
- package/api-docs/variables/isRejected.mdx +3 -0
- package/api-docs/variables/isRejectedOnlyAudio.mdx +3 -0
- package/api-docs/variables/isRejectedOnlyVideo.mdx +3 -0
- package/api-docs/variables/isRequestPermissionNeeded.mdx +3 -0
- package/api-docs/variables/isUnknownError.mdx +3 -0
- package/api-docs/variables/isVideoDeviceInUse.mdx +3 -0
- package/package.json +17 -12
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createMediaSignals<K>(more, scope): Pick<Required<MediaSignals>, SignalKeys>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create and return all required and optional (if specified with `more`),
|
|
6
|
+
signals for media to work
|
|
7
|
+
|
|
8
|
+
## Type Parameters
|
|
9
|
+
|
|
10
|
+
| Type Parameter |
|
|
11
|
+
| ------ |
|
|
12
|
+
| `K` *extends* \| `"onAddTrack"` \| `"onDevicesChanged"` \| `"onMediaTrackMuted"` \| `"onMediaTrackResumed"` \| `"onMediaTrackStopped"` \| `"onMediaTrackSuspended"` \| `"onRemoveTrack"` \| `"onStatusChanged"` \| `"onUpdatingAudio"` \| `"onUpdatingVideo"` |
|
|
13
|
+
|
|
14
|
+
## Parameters
|
|
15
|
+
|
|
16
|
+
| Parameter | Type | Default value | Description |
|
|
17
|
+
| ------ | ------ | ------ | ------ |
|
|
18
|
+
| `more` | `K`[] | `undefined` | Keys from `MediaSignalsOptional`, |
|
|
19
|
+
| `scope` | `string` | `''` | any scope prefix for the generated signal name, |
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
`Pick`\<`Required`\<[`MediaSignals`](../type-aliases/MediaSignals.mdx)\>, `SignalKeys`\>
|
|
24
|
+
|
|
25
|
+
## See
|
|
26
|
+
|
|
27
|
+
- MediaSignalsOptional
|
|
28
|
+
- Signal
|
|
29
|
+
|
|
30
|
+
The following signals created by default
|
|
31
|
+
- 'onMediaChanged',
|
|
32
|
+
- 'onVAD',
|
|
33
|
+
- REQUIRED_SIGNAL_KEYS
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createPreviewStreamController(__namedParameters): PreviewStreamController;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Parameter | Type |
|
|
8
|
+
| ------ | ------ |
|
|
9
|
+
| `__namedParameters` | [`PreviewStreamParams`](../interfaces/PreviewStreamParams.mdx) |
|
|
10
|
+
|
|
11
|
+
## Returns
|
|
12
|
+
|
|
13
|
+
[`PreviewStreamController`](../interfaces/PreviewStreamController.mdx)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createVideoStreamProcess(__namedParameters): TrackProcessor;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Parameter | Type |
|
|
8
|
+
| ------ | ------ |
|
|
9
|
+
| `__namedParameters` | `VideoStreamProcessOptions` |
|
|
10
|
+
|
|
11
|
+
## Returns
|
|
12
|
+
|
|
13
|
+
[`TrackProcessor`](../type-aliases/TrackProcessor.mdx)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function deriveInitialPermissionStatus(prevStatus, getPermissionState): Promise<UserMediaStatus>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Parameter | Type | Default value |
|
|
8
|
+
| ------ | ------ | ------ |
|
|
9
|
+
| `prevStatus` | [`UserMediaStatus`](../enumerations/UserMediaStatus.mdx) | `undefined` |
|
|
10
|
+
| `getPermissionState` | (`anyActiveAudioTrack?`, `anyActiveVideoTrack?`, `getDevices?`) => `Promise`\<`InputDevicePermission`\> | `getInputDevicePermissionState` |
|
|
11
|
+
|
|
12
|
+
## Returns
|
|
13
|
+
|
|
14
|
+
`Promise`\<[`UserMediaStatus`](../enumerations/UserMediaStatus.mdx)\>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function getPermissionStatus(__namedParameters):
|
|
3
|
+
| Initial
|
|
4
|
+
| InitialPermissionsGranted
|
|
5
|
+
| InitialPermissionsNotGranted
|
|
6
|
+
| InitialPermissionsVideoInputDenied
|
|
7
|
+
| InitialPermissionsAudioInputDenied
|
|
8
|
+
| InitialPermissionsVideoInputGranted
|
|
9
|
+
| InitialPermissionsAudioInputGranted
|
|
10
|
+
| InitialPermissionsGrantedVideoInputDenied
|
|
11
|
+
| InitialPermissionsGrantedAudioInputDenied
|
|
12
|
+
| PermissionsRejected;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type |
|
|
18
|
+
| ------ | ------ |
|
|
19
|
+
| `__namedParameters` | \{ `audio`: `PermissionState`; `video`: `PermissionState`; \} |
|
|
20
|
+
| `__namedParameters.audio` | `PermissionState` |
|
|
21
|
+
| `__namedParameters.video` | `PermissionState` |
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
\| [`Initial`](../enumerations/UserMediaStatus.mdx#initial)
|
|
26
|
+
\| [`InitialPermissionsGranted`](../enumerations/UserMediaStatus.mdx#initialpermissionsgranted)
|
|
27
|
+
\| [`InitialPermissionsNotGranted`](../enumerations/UserMediaStatus.mdx#initialpermissionsnotgranted)
|
|
28
|
+
\| [`InitialPermissionsVideoInputDenied`](../enumerations/UserMediaStatus.mdx#initialpermissionsvideoinputdenied)
|
|
29
|
+
\| [`InitialPermissionsAudioInputDenied`](../enumerations/UserMediaStatus.mdx#initialpermissionsaudioinputdenied)
|
|
30
|
+
\| [`InitialPermissionsVideoInputGranted`](../enumerations/UserMediaStatus.mdx#initialpermissionsvideoinputgranted)
|
|
31
|
+
\| [`InitialPermissionsAudioInputGranted`](../enumerations/UserMediaStatus.mdx#initialpermissionsaudioinputgranted)
|
|
32
|
+
\| [`InitialPermissionsGrantedVideoInputDenied`](../enumerations/UserMediaStatus.mdx#initialpermissionsgrantedvideoinputdenied)
|
|
33
|
+
\| [`InitialPermissionsGrantedAudioInputDenied`](../enumerations/UserMediaStatus.mdx#initialpermissionsgrantedaudioinputdenied)
|
|
34
|
+
\| [`PermissionsRejected`](../enumerations/UserMediaStatus.mdx#permissionsrejected)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function isVideoStreamTrackProcessorAPIs(value): value is VideoStreamTrackProcessorAPIs;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Parameter | Type |
|
|
8
|
+
| ------ | ------ |
|
|
9
|
+
| `value` | `unknown` |
|
|
10
|
+
|
|
11
|
+
## Returns
|
|
12
|
+
|
|
13
|
+
`value is VideoStreamTrackProcessorAPIs`
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function toDeniedDevices(status?): DeniedDevices | undefined;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Parameter | Type |
|
|
8
|
+
| ------ | ------ |
|
|
9
|
+
| `status?` | [`UserMediaStatus`](../enumerations/UserMediaStatus.mdx) |
|
|
10
|
+
|
|
11
|
+
## Returns
|
|
12
|
+
|
|
13
|
+
[`DeniedDevices`](../enumerations/DeniedDevices.mdx) \| `undefined`
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
## Properties
|
|
2
|
+
|
|
3
|
+
| Property | Type | Description |
|
|
4
|
+
| ------ | ------ | ------ |
|
|
5
|
+
| <a id="audiosignaldetectionduration"></a> `audioSignalDetectionDuration?` | `number` | Audio Signal Detection Duration in second |
|
|
6
|
+
| <a id="shoulddetectaudio"></a> `shouldDetectAudio` | () => `boolean` | Whether or not to detect audio signal for malfunctioning device |
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
URL links needed for creating a denoise node for audio processing
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Property | Type | Description |
|
|
6
|
+
| ------ | ------ | ------ |
|
|
7
|
+
| <a id="wasmurl"></a> `wasmURL` | `string` | wasm URL to get the denoise wasm |
|
|
8
|
+
| <a id="workletmodule"></a> `workletModule` | `string` | AudioWorklet module URL to get the worklet, **See** AudioContext['audioWorklet']['addModule'] |
|
|
9
|
+
| <a id="workletoptions"></a> `workletOptions?` | `WorkletOptions` | AudioWorklet options to pass **See** AudioContext['audioWorklet']['addModule'] |
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
## Extends
|
|
2
|
+
|
|
3
|
+
- `MediaTrackSettings`
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Type | Overrides | Inherited from |
|
|
8
|
+
| ------ | ------ | ------ | ------ |
|
|
9
|
+
| <a id="mixwithadditionalmedia"></a> `mixWithAdditionalMedia?` | `boolean` | - | - |
|
|
10
|
+
| <a id="channelcount"></a> `channelCount?` | `number` | `MediaTrackSettings.channelCount` | - |
|
|
11
|
+
| <a id="denoise"></a> `denoise?` | `boolean` | - | - |
|
|
12
|
+
| <a id="vad"></a> `vad?` | `boolean` | - | - |
|
|
13
|
+
| <a id="asd"></a> `asd?` | `boolean` | - | - |
|
|
14
|
+
| <a id="backgroundbluramount"></a> `backgroundBlurAmount?` | `number` | - | - |
|
|
15
|
+
| <a id="backgroundimageurl"></a> `backgroundImageUrl?` | `string` | - | - |
|
|
16
|
+
| <a id="edgebluramount"></a> `edgeBlurAmount?` | `number` | - | - |
|
|
17
|
+
| <a id="maskcombineratio"></a> `maskCombineRatio?` | `number` | - | - |
|
|
18
|
+
| <a id="foregroundthreshold"></a> `foregroundThreshold?` | `number` | - | - |
|
|
19
|
+
| <a id="videosegmentation"></a> `videoSegmentation?` | `"none"` \| `"blur"` \| `"overlay"` | - | - |
|
|
20
|
+
| <a id="videosegmentationmodel"></a> `videoSegmentationModel?` | `SegmentationModel` | - | - |
|
|
21
|
+
| <a id="pan"></a> `pan?` | `boolean` | - | - |
|
|
22
|
+
| <a id="tilt"></a> `tilt?` | `boolean` | - | - |
|
|
23
|
+
| <a id="zoom"></a> `zoom?` | `boolean` | - | - |
|
|
24
|
+
| <a id="contenthint"></a> `contentHint?` | \| `""` \| `"speech"` \| `"speech-recognition"` \| `"music"` \| `"motion"` \| `"detail"` \| `"text"` | - | - |
|
|
25
|
+
| <a id="aspectratio"></a> `aspectRatio?` | `number` | - | `MediaTrackSettings.aspectRatio` |
|
|
26
|
+
| <a id="autogaincontrol"></a> `autoGainControl?` | `boolean` | - | `MediaTrackSettings.autoGainControl` |
|
|
27
|
+
| <a id="backgroundblur"></a> `backgroundBlur?` | `boolean` | - | `MediaTrackSettings.backgroundBlur` |
|
|
28
|
+
| <a id="deviceid"></a> `deviceId?` | `string` | - | `MediaTrackSettings.deviceId` |
|
|
29
|
+
| <a id="displaysurface"></a> `displaySurface?` | `string` | - | `MediaTrackSettings.displaySurface` |
|
|
30
|
+
| <a id="echocancellation"></a> `echoCancellation?` | `boolean` | - | `MediaTrackSettings.echoCancellation` |
|
|
31
|
+
| <a id="facingmode"></a> `facingMode?` | `string` | - | `MediaTrackSettings.facingMode` |
|
|
32
|
+
| <a id="framerate"></a> `frameRate?` | `number` | - | `MediaTrackSettings.frameRate` |
|
|
33
|
+
| <a id="groupid"></a> `groupId?` | `string` | - | `MediaTrackSettings.groupId` |
|
|
34
|
+
| <a id="height"></a> `height?` | `number` | - | `MediaTrackSettings.height` |
|
|
35
|
+
| <a id="noisesuppression"></a> `noiseSuppression?` | `boolean` | - | `MediaTrackSettings.noiseSuppression` |
|
|
36
|
+
| <a id="samplerate"></a> `sampleRate?` | `number` | - | `MediaTrackSettings.sampleRate` |
|
|
37
|
+
| <a id="samplesize"></a> `sampleSize?` | `number` | - | `MediaTrackSettings.sampleSize` |
|
|
38
|
+
| <a id="width"></a> `width?` | `number` | - | `MediaTrackSettings.width` |
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
## Extends
|
|
2
|
+
|
|
3
|
+
- [`MediaAttributes`](MediaAttributes.mdx)
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Modifier | Type | Description | Inherited from |
|
|
8
|
+
| ------ | ------ | ------ | ------ | ------ |
|
|
9
|
+
| <a id="active"></a> `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`](MediaAttributes.mdx).[`active`](MediaAttributes.mdx#active) |
|
|
10
|
+
| <a id="id"></a> `id` | `readonly` | `string` | A string containing a 36-character universally unique identifier (UUID) for the object. | [`MediaAttributes`](MediaAttributes.mdx).[`id`](MediaAttributes.mdx#id) |
|
|
11
|
+
| <a id="devices"></a> `devices` | `public` | `IndexedDevices` | The devices used for the media | [`MediaAttributes`](MediaAttributes.mdx).[`devices`](MediaAttributes.mdx#devices) |
|
|
12
|
+
| <a id="stream"></a> `stream` | `public` | `MediaStream` | Media stream for the media | [`MediaAttributes`](MediaAttributes.mdx).[`stream`](MediaAttributes.mdx#stream) |
|
|
13
|
+
| <a id="expectedaudioinput"></a> `expectedAudioInput?` | `public` | `MediaDeviceInfoLike` | The audio input device which is expected to be used for the current stream based on the provided constraints | [`MediaAttributes`](MediaAttributes.mdx).[`expectedAudioInput`](MediaAttributes.mdx#expectedaudioinput) |
|
|
14
|
+
| <a id="expectedvideoinput"></a> `expectedVideoInput?` | `public` | `MediaDeviceInfoLike` | The video input device which is expected to be used for the current stream based on the provided constraints | [`MediaAttributes`](MediaAttributes.mdx).[`expectedVideoInput`](MediaAttributes.mdx#expectedvideoinput) |
|
|
15
|
+
| <a id="status"></a> `status` | `public` | [`UserMediaStatus`](../enumerations/UserMediaStatus.mdx) | The status of the media | [`MediaAttributes`](MediaAttributes.mdx).[`status`](MediaAttributes.mdx#status) |
|
|
16
|
+
| <a id="audiomuted"></a> `audioMuted` | `public` | `boolean` \| `undefined` | Current mute state of audio track `undefined` means there is no such track from the stream | [`MediaAttributes`](MediaAttributes.mdx).[`audioMuted`](MediaAttributes.mdx#audiomuted) |
|
|
17
|
+
| <a id="videomuted"></a> `videoMuted` | `public` | `boolean` \| `undefined` | Current mute state of video track `undefined` means there is no such track from the stream | [`MediaAttributes`](MediaAttributes.mdx).[`videoMuted`](MediaAttributes.mdx#videomuted) |
|
|
18
|
+
| <a id="audioinput"></a> `audioInput?` | `public` | `MediaDeviceInfoLike` | Audio input device is used for the audio track from the current stream | [`MediaAttributes`](MediaAttributes.mdx).[`audioInput`](MediaAttributes.mdx#audioinput) |
|
|
19
|
+
| <a id="videoinput"></a> `videoInput?` | `public` | `MediaDeviceInfoLike` | Video input device is used for the video track from the current stream | [`MediaAttributes`](MediaAttributes.mdx).[`videoInput`](MediaAttributes.mdx#videoinput) |
|
|
20
|
+
|
|
21
|
+
## Methods
|
|
22
|
+
|
|
23
|
+
### muteAudio()
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
muteAudio(mute): void;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
mute/unmute the audio track
|
|
30
|
+
|
|
31
|
+
#### Parameters
|
|
32
|
+
|
|
33
|
+
| Parameter | Type |
|
|
34
|
+
| ------ | ------ |
|
|
35
|
+
| `mute` | `boolean` |
|
|
36
|
+
|
|
37
|
+
#### Returns
|
|
38
|
+
|
|
39
|
+
`void`
|
|
40
|
+
|
|
41
|
+
***
|
|
42
|
+
|
|
43
|
+
### muteVideo()
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
muteVideo(mute): void;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
mute/unmute the video track
|
|
50
|
+
|
|
51
|
+
#### Parameters
|
|
52
|
+
|
|
53
|
+
| Parameter | Type |
|
|
54
|
+
| ------ | ------ |
|
|
55
|
+
| `mute` | `boolean` |
|
|
56
|
+
|
|
57
|
+
#### Returns
|
|
58
|
+
|
|
59
|
+
`void`
|
|
60
|
+
|
|
61
|
+
***
|
|
62
|
+
|
|
63
|
+
### applyConstraints()
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
applyConstraints(constraints): Promise<void>;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Apply the constraints to the current media
|
|
70
|
+
|
|
71
|
+
#### Parameters
|
|
72
|
+
|
|
73
|
+
| Parameter | Type |
|
|
74
|
+
| ------ | ------ |
|
|
75
|
+
| `constraints` | `MediaDeviceRequest` |
|
|
76
|
+
|
|
77
|
+
#### Returns
|
|
78
|
+
|
|
79
|
+
`Promise`\<`void`\>
|
|
80
|
+
|
|
81
|
+
***
|
|
82
|
+
|
|
83
|
+
### release()
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
release(): Promise<void>;
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Release the media resources, e.g. camera/microphone
|
|
90
|
+
|
|
91
|
+
#### Returns
|
|
92
|
+
|
|
93
|
+
`Promise`\<`void`\>
|
|
94
|
+
|
|
95
|
+
***
|
|
96
|
+
|
|
97
|
+
### getConstraints()
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
getConstraints(): MediaDeviceRequest;
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### Returns
|
|
104
|
+
|
|
105
|
+
`MediaDeviceRequest`
|
|
106
|
+
|
|
107
|
+
***
|
|
108
|
+
|
|
109
|
+
### setOriginalConstraints()
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
setOriginalConstraints(constraints): void;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### Parameters
|
|
116
|
+
|
|
117
|
+
| Parameter | Type |
|
|
118
|
+
| ------ | ------ |
|
|
119
|
+
| `constraints` | `MediaDeviceRequest` |
|
|
120
|
+
|
|
121
|
+
#### Returns
|
|
122
|
+
|
|
123
|
+
`void`
|
|
124
|
+
|
|
125
|
+
***
|
|
126
|
+
|
|
127
|
+
### getOriginalConstraints()
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
getOriginalConstraints(): MediaDeviceRequest;
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
#### Returns
|
|
134
|
+
|
|
135
|
+
`MediaDeviceRequest`
|
|
136
|
+
|
|
137
|
+
***
|
|
138
|
+
|
|
139
|
+
### isAudioInputUnavailable()
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
isAudioInputUnavailable(): boolean;
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
#### Returns
|
|
146
|
+
|
|
147
|
+
`boolean`
|
|
148
|
+
|
|
149
|
+
***
|
|
150
|
+
|
|
151
|
+
### isVideoInputUnavailable()
|
|
152
|
+
|
|
153
|
+
```ts
|
|
154
|
+
isVideoInputUnavailable(): boolean;
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
#### Returns
|
|
158
|
+
|
|
159
|
+
`boolean`
|
|
160
|
+
|
|
161
|
+
***
|
|
162
|
+
|
|
163
|
+
### requestedAudio()
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
requestedAudio(): boolean;
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
#### Returns
|
|
170
|
+
|
|
171
|
+
`boolean`
|
|
172
|
+
|
|
173
|
+
***
|
|
174
|
+
|
|
175
|
+
### requestedVideo()
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
requestedVideo(): boolean;
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
#### Returns
|
|
182
|
+
|
|
183
|
+
`boolean`
|
|
184
|
+
|
|
185
|
+
***
|
|
186
|
+
|
|
187
|
+
### getSettings()
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
getSettings(): MediaSettings;
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
#### Returns
|
|
194
|
+
|
|
195
|
+
[`MediaSettings`](MediaSettings.mdx)
|
|
196
|
+
|
|
197
|
+
***
|
|
198
|
+
|
|
199
|
+
### toJSON()
|
|
200
|
+
|
|
201
|
+
```ts
|
|
202
|
+
toJSON(): unknown;
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
#### Returns
|
|
206
|
+
|
|
207
|
+
`unknown`
|
|
208
|
+
|
|
209
|
+
***
|
|
210
|
+
|
|
211
|
+
### getTracks()
|
|
212
|
+
|
|
213
|
+
```ts
|
|
214
|
+
getTracks(): MediaTrack[];
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
#### Returns
|
|
218
|
+
|
|
219
|
+
[`MediaTrack`](MediaTrack.mdx)[]
|
|
220
|
+
|
|
221
|
+
***
|
|
222
|
+
|
|
223
|
+
### getAudioTracks()
|
|
224
|
+
|
|
225
|
+
```ts
|
|
226
|
+
getAudioTracks(): MediaTrack[];
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
#### Returns
|
|
230
|
+
|
|
231
|
+
[`MediaTrack`](MediaTrack.mdx)[]
|
|
232
|
+
|
|
233
|
+
***
|
|
234
|
+
|
|
235
|
+
### getVideoTracks()
|
|
236
|
+
|
|
237
|
+
```ts
|
|
238
|
+
getVideoTracks(): MediaTrack[];
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
#### Returns
|
|
242
|
+
|
|
243
|
+
[`MediaTrack`](MediaTrack.mdx)[]
|
|
244
|
+
|
|
245
|
+
***
|
|
246
|
+
|
|
247
|
+
### addTrack()
|
|
248
|
+
|
|
249
|
+
```ts
|
|
250
|
+
addTrack(track): void;
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
#### Parameters
|
|
254
|
+
|
|
255
|
+
| Parameter | Type |
|
|
256
|
+
| ------ | ------ |
|
|
257
|
+
| `track` | [`MediaTrack`](MediaTrack.mdx) |
|
|
258
|
+
|
|
259
|
+
#### Returns
|
|
260
|
+
|
|
261
|
+
`void`
|
|
262
|
+
|
|
263
|
+
***
|
|
264
|
+
|
|
265
|
+
### isCurrentTrack()
|
|
266
|
+
|
|
267
|
+
```ts
|
|
268
|
+
isCurrentTrack(track): boolean;
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
#### Parameters
|
|
272
|
+
|
|
273
|
+
| Parameter | Type |
|
|
274
|
+
| ------ | ------ |
|
|
275
|
+
| `track` | [`MediaTrack`](MediaTrack.mdx) |
|
|
276
|
+
|
|
277
|
+
#### Returns
|
|
278
|
+
|
|
279
|
+
`boolean`
|
|
280
|
+
|
|
281
|
+
***
|
|
282
|
+
|
|
283
|
+
### removeTrack()
|
|
284
|
+
|
|
285
|
+
```ts
|
|
286
|
+
removeTrack(track): void;
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
#### Parameters
|
|
290
|
+
|
|
291
|
+
| Parameter | Type |
|
|
292
|
+
| ------ | ------ |
|
|
293
|
+
| `track` | [`MediaTrack`](MediaTrack.mdx) |
|
|
294
|
+
|
|
295
|
+
#### Returns
|
|
296
|
+
|
|
297
|
+
`void`
|
|
298
|
+
|
|
299
|
+
***
|
|
300
|
+
|
|
301
|
+
### clone()
|
|
302
|
+
|
|
303
|
+
```ts
|
|
304
|
+
clone(signals?, label?): Media;
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
#### Parameters
|
|
308
|
+
|
|
309
|
+
| Parameter | Type |
|
|
310
|
+
| ------ | ------ |
|
|
311
|
+
| `signals?` | [`MediaSignals`](../type-aliases/MediaSignals.mdx) |
|
|
312
|
+
| `label?` | `string` |
|
|
313
|
+
|
|
314
|
+
#### Returns
|
|
315
|
+
|
|
316
|
+
`Media`
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
## Extended by
|
|
2
|
+
|
|
3
|
+
- [`Media`](Media.mdx)
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Modifier | Type | Description |
|
|
8
|
+
| ------ | ------ | ------ | ------ |
|
|
9
|
+
| <a id="active"></a> `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. |
|
|
10
|
+
| <a id="id"></a> `id` | `readonly` | `string` | A string containing a 36-character universally unique identifier (UUID) for the object. |
|
|
11
|
+
| <a id="devices"></a> `devices` | `public` | `IndexedDevices` | The devices used for the media |
|
|
12
|
+
| <a id="stream"></a> `stream` | `public` | `MediaStream` | Media stream for the media |
|
|
13
|
+
| <a id="expectedaudioinput"></a> `expectedAudioInput?` | `public` | `MediaDeviceInfoLike` | The audio input device which is expected to be used for the current stream based on the provided constraints |
|
|
14
|
+
| <a id="expectedvideoinput"></a> `expectedVideoInput?` | `public` | `MediaDeviceInfoLike` | The video input device which is expected to be used for the current stream based on the provided constraints |
|
|
15
|
+
| <a id="status"></a> `status` | `public` | [`UserMediaStatus`](../enumerations/UserMediaStatus.mdx) | The status of the media |
|
|
16
|
+
| <a id="audiomuted"></a> `audioMuted` | `public` | `boolean` \| `undefined` | Current mute state of audio track `undefined` means there is no such track from the stream |
|
|
17
|
+
| <a id="videomuted"></a> `videoMuted` | `public` | `boolean` \| `undefined` | Current mute state of video track `undefined` means there is no such track from the stream |
|
|
18
|
+
| <a id="audioinput"></a> `audioInput?` | `public` | `MediaDeviceInfoLike` | Audio input device is used for the audio track from the current stream |
|
|
19
|
+
| <a id="videoinput"></a> `videoInput?` | `public` | `MediaDeviceInfoLike` | Video input device is used for the video track from the current stream |
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## Properties
|
|
2
|
+
|
|
3
|
+
| Property | Type |
|
|
4
|
+
| ------ | ------ |
|
|
5
|
+
| <a id="onaddtrack"></a> `onAddTrack` | `Signal`\<`MediaStreamTrack`\> |
|
|
6
|
+
| <a id="ondeviceschanged"></a> `onDevicesChanged` | `Signal`\<`IndexedDevices`\> |
|
|
7
|
+
| <a id="onmediachanged"></a> `onMediaChanged` | `Signal`\<[`Media`](Media.mdx) \| `undefined`\> |
|
|
8
|
+
| <a id="onmediatrackmuted"></a> `onMediaTrackMuted` | `Signal`\<[`MediaTrack`](MediaTrack.mdx)\> |
|
|
9
|
+
| <a id="onmediatrackresumed"></a> `onMediaTrackResumed` | `Signal`\<[`MediaTrack`](MediaTrack.mdx)\> |
|
|
10
|
+
| <a id="onmediatrackstopped"></a> `onMediaTrackStopped` | `Signal`\<[`MediaTrack`](MediaTrack.mdx)\> |
|
|
11
|
+
| <a id="onmediatracksuspended"></a> `onMediaTrackSuspended` | `Signal`\<[`MediaTrack`](MediaTrack.mdx)\> |
|
|
12
|
+
| <a id="onremovetrack"></a> `onRemoveTrack` | `Signal`\<`MediaStreamTrack`\> |
|
|
13
|
+
| <a id="onstatuschanged"></a> `onStatusChanged` | `Signal`\<[`UserMediaStatus`](../enumerations/UserMediaStatus.mdx)\> |
|
|
14
|
+
| <a id="onupdatingaudio"></a> `onUpdatingAudio` | `Signal`\<`boolean`\> |
|
|
15
|
+
| <a id="onupdatingvideo"></a> `onUpdatingVideo` | `Signal`\<`boolean`\> |
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
## Properties
|
|
2
|
+
|
|
3
|
+
| Property | Modifier | Type | Description |
|
|
4
|
+
| ------ | ------ | ------ | ------ |
|
|
5
|
+
| <a id="updatingaudio"></a> `updatingAudio` | `readonly` | `boolean` | - |
|
|
6
|
+
| <a id="updatingvideo"></a> `updatingVideo` | `readonly` | `boolean` | - |
|
|
7
|
+
| <a id="media"></a> `media?` | `readonly` | [`Media`](Media.mdx) | Current Media |
|
|
8
|
+
| <a id="devices"></a> `devices` | `readonly` | `IndexedDevices` | Current device list |
|
|
9
|
+
| <a id="getusermedia"></a> `getUserMedia` | `public` | (`constraints`) => `void` | Execute the media pipeline immediately with provided constraints **See** MediaDeviceRequest |
|
|
10
|
+
| <a id="getusermediaasync"></a> `getUserMediaAsync` | `public` | (`constraints`) => `Promise`\<`void`\> | Execute the media pipeline immediately with provided constraints. An explicit version of `getUserMedia` to make it possible to chain other async actions **See** MediaDeviceRequest |
|
|
11
|
+
| <a id="tryandgetusermedia"></a> `tryAndGetUserMedia` | `public` | (`constraints`) => `void` | Cross-check PermissionState and available devices before requesting user media, the request will be skipped if there is no granted device. |
|