@pexip/media 21.0.0 → 22.1.0
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 +66 -0
- package/README.md +20 -32
- package/api-docs/README.mdx +20 -35
- package/api-docs/functions/applyContentHint.mdx +1 -1
- package/api-docs/functions/createAudioMixingProcess.mdx +1 -1
- package/api-docs/functions/createGetDisplayMedia.mdx +3 -3
- package/api-docs/functions/createMediaSignal.mdx +2 -2
- package/api-docs/functions/createMediaSignals.mdx +5 -3
- package/api-docs/functions/deriveInitialPermissionStatus.mdx +4 -2
- package/api-docs/functions/getPermissionStatus.mdx +31 -11
- package/api-docs/functions/toDeniedDevices.mdx +3 -1
- package/api-docs/interfaces/AudioDetectionSignals.mdx +2 -2
- package/api-docs/interfaces/AudioSignalDetectionOptions.mdx +1 -1
- package/api-docs/interfaces/ExtendedMediaTrackSettings.mdx +11 -7
- package/api-docs/interfaces/Media.mdx +4 -4
- package/api-docs/interfaces/MediaAttributes.mdx +2 -2
- package/api-docs/interfaces/MediaChangesSignals.mdx +5 -5
- package/api-docs/interfaces/MediaController.mdx +3 -3
- package/api-docs/interfaces/MediaInit.mdx +1 -1
- package/api-docs/interfaces/MediaOptions.mdx +3 -3
- package/api-docs/interfaces/MediaTrack.mdx +3 -3
- package/api-docs/interfaces/MediaTrackInit.mdx +12 -10
- package/api-docs/interfaces/PreviewControllerProps.mdx +1 -0
- package/api-docs/interfaces/PreviewEventHandler.mdx +7 -7
- package/api-docs/interfaces/PreviewStreamController.mdx +10 -10
- package/api-docs/interfaces/PreviewStreamParams.mdx +7 -6
- package/api-docs/interfaces/VoiceActivityDetectionOptions.mdx +1 -1
- package/api-docs/type-aliases/GetUserMediaProcess.mdx +4 -2
- package/api-docs/type-aliases/Process.mdx +3 -1
- package/api-docs/variables/internalSignals.mdx +1 -1
- package/dist/audioMixingProcessor.d.ts +4 -2
- package/dist/audioMixingProcessor.js +22 -12
- package/dist/audioProcessor.d.ts +7 -2
- package/dist/audioProcessor.js +25 -20
- package/dist/logger.d.ts +0 -2
- package/dist/logger.js +0 -16
- package/dist/media.js +5 -5
- package/dist/previewController.d.ts +3 -1
- package/dist/previewController.js +42 -9
- package/dist/typeGuard.d.ts +1 -2
- package/dist/typeGuard.js +0 -3
- package/dist/types.d.ts +7 -14
- package/dist/utils.js +15 -5
- package/dist/videoProcessor.d.ts +40 -22
- package/dist/videoProcessor.js +227 -247
- package/package.json +11 -11
- package/api-docs/functions/isVideoStreamTrackProcessorAPIs.mdx +0 -13
- package/api-docs/type-aliases/Segmenters.mdx +0 -3
- package/api-docs/type-aliases/VideoStreamTrackProcessorAPIs.mdx +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,71 @@
|
|
|
1
1
|
# @pexip/media
|
|
2
2
|
|
|
3
|
+
## 22.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 44ad859: Move proxyWithLog to utils
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 588b6e1: Fix process stopped track
|
|
12
|
+
- 49e9299: Fix process stopped track issue
|
|
13
|
+
- 136aa70: Fix race on close
|
|
14
|
+
- Updated dependencies [a9456de]
|
|
15
|
+
- Updated dependencies [44ad859]
|
|
16
|
+
- Updated dependencies [136aa70]
|
|
17
|
+
- Updated dependencies [ad47e6a]
|
|
18
|
+
- Updated dependencies [514c523]
|
|
19
|
+
- @pexip/media-control@22.1.0
|
|
20
|
+
- @pexip/utils@17.4.0
|
|
21
|
+
- @pexip/media-processor@22.1.0
|
|
22
|
+
|
|
23
|
+
## 22.0.0
|
|
24
|
+
|
|
25
|
+
### Major Changes
|
|
26
|
+
|
|
27
|
+
- 498ff3b: - **`createVideoStreamProcess` refactored**:
|
|
28
|
+
- No longer accepts `segmenters`, `transformer`, `trackProcessorAPI`, or
|
|
29
|
+
`videoSegmentationModel`.
|
|
30
|
+
- Now requires a `getVideoProcessor: () => VideoProcessor` factory.
|
|
31
|
+
- All render option updates go through
|
|
32
|
+
`videoProcessor.update({renderOptions})` instead of direct transformer
|
|
33
|
+
property mutation.
|
|
34
|
+
- `applyFeatures` is now `async`.
|
|
35
|
+
- **`videoSegmentationModel` removed** from constraints, settings, and types.
|
|
36
|
+
- **`Segmenters` type removed**.
|
|
37
|
+
- **`isVideoStreamTrackProcessorAPIs` removed**
|
|
38
|
+
|
|
39
|
+
### Minor Changes
|
|
40
|
+
|
|
41
|
+
- 7d986cc: - Adds new optional `stopVideoTrackAsMute` prop to
|
|
42
|
+
`PreviewStreamParams` of `previewController.ts`. This is forwarded to
|
|
43
|
+
`createGetUserMediaProcess`, defaults to `() => false`
|
|
44
|
+
- Preview controller always syncs current video track mute state with new one
|
|
45
|
+
after it is acquired unless explicitly forced to not do so.
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- f8bd1c5: Fix VideoProcessor and Segment open/update behavior
|
|
50
|
+
- d2fd777: Fix `mapSettingsToFeatures` and `mapFeatureToSettings` Proxy handlers
|
|
51
|
+
to include `ownKeys`, `has`, and `getOwnPropertyDescriptor` traps. Previously,
|
|
52
|
+
the proxies wrapped an empty object, causing `Object.keys()`, `for...in`,
|
|
53
|
+
`hasOwn()`, and `isEmpty()` to see no properties. This could silently skip
|
|
54
|
+
constraint application and cause downstream logic to receive incorrect values.
|
|
55
|
+
- fb41d4d: Changes related to Typescript V6 Upgrade
|
|
56
|
+
- Updated dependencies [f8bd1c5]
|
|
57
|
+
- Updated dependencies [498ff3b]
|
|
58
|
+
- Updated dependencies [498ff3b]
|
|
59
|
+
- Updated dependencies [498ff3b]
|
|
60
|
+
- Updated dependencies [925cce6]
|
|
61
|
+
- Updated dependencies [fb41d4d]
|
|
62
|
+
- Updated dependencies [fe0a0a4]
|
|
63
|
+
- Updated dependencies [b99c070]
|
|
64
|
+
- @pexip/media-processor@22.0.0
|
|
65
|
+
- @pexip/utils@17.3.0
|
|
66
|
+
- @pexip/media-control@22.0.0
|
|
67
|
+
- @pexip/signal@16.9.5
|
|
68
|
+
|
|
3
69
|
## 21.0.0
|
|
4
70
|
|
|
5
71
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ create a streamlined media process
|
|
|
11
11
|
|
|
12
12
|
### `createMedia`
|
|
13
13
|
|
|
14
|
-
It
|
|
14
|
+
It creates an object to interact with the media stream, which is usually used
|
|
15
15
|
for our main stream.
|
|
16
16
|
|
|
17
17
|
Its major features:
|
|
@@ -67,11 +67,6 @@ export interface InputConstraintSet extends MediaTrackConstraints {
|
|
|
67
67
|
* segment. Available effects are `none`, `blur`, `overlay` or `remove`
|
|
68
68
|
*/
|
|
69
69
|
videoSegmentation?: ConstrainDOMString;
|
|
70
|
-
/**
|
|
71
|
-
* Segmentation model to be used for video segmentation, currently only
|
|
72
|
-
* supports `mediapipeSelfie` and `personify`
|
|
73
|
-
*/
|
|
74
|
-
videoSegmentationModel?: ConstrainDOMString;
|
|
75
70
|
/**
|
|
76
71
|
* Whether or not using our own noise suppression
|
|
77
72
|
*/
|
|
@@ -133,12 +128,8 @@ export interface InputConstraintSet extends MediaTrackConstraints {
|
|
|
133
128
|
|
|
134
129
|
```typescript
|
|
135
130
|
import {createMedia, createMediaSignals, UserMediaStatus} from '@pexip/media';
|
|
136
|
-
import type {RenderEffects,
|
|
137
|
-
import {
|
|
138
|
-
createSegmenter,
|
|
139
|
-
createCanvasTransform,
|
|
140
|
-
createVideoProcessor,
|
|
141
|
-
} from '@pexip/media-processor';
|
|
131
|
+
import type {RenderEffects, Media} from '@pexip/media';
|
|
132
|
+
import {createSegmenter, createVideoProcessor} from '@pexip/media-processor';
|
|
142
133
|
|
|
143
134
|
// App states
|
|
144
135
|
const states: {
|
|
@@ -186,32 +177,29 @@ const modelAsset = {
|
|
|
186
177
|
modelName: 'selfie' as const,
|
|
187
178
|
};
|
|
188
179
|
|
|
189
|
-
const
|
|
190
|
-
// Create a processing transformer and set the effects to `blur`
|
|
191
|
-
const transformer = createCanvasTransform(segmenter, {
|
|
192
|
-
effects: states.effects,
|
|
193
|
-
foregroundThreshold: states.foregroundThreshold,
|
|
194
|
-
backgroundBlurAmount: states.backgroundBlurAmount,
|
|
195
|
-
maskCombineRatio: states.maskCombineRatio,
|
|
196
|
-
backgroundImageUrl: states.backgroundImageUrl,
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
const selfie = createSegmenter(taskVisionBasePath, {
|
|
180
|
+
const selfie = createSegmenter(tasksVisionBasePath, {
|
|
200
181
|
modelAsset,
|
|
201
182
|
delegate: () => 'GPU', // Use GPU
|
|
202
183
|
});
|
|
203
184
|
|
|
204
|
-
export const segmenters: Partial<Segmenters> = {
|
|
205
|
-
selfie,
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
const videoProcessor = createVideoProcessor([transformer]);
|
|
209
|
-
|
|
210
185
|
const videoStreamProcessor = createVideoStreamProcess({
|
|
211
186
|
shouldEnable: () => true, // Always Process Video Track
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
187
|
+
getVideoProcessor: () => {
|
|
188
|
+
return createVideoProcessor(
|
|
189
|
+
selfie,
|
|
190
|
+
getDefaultInputProcessAdaptor(
|
|
191
|
+
chooseVideoProcessorAPI() === 'stream',
|
|
192
|
+
FRAME_RATE,
|
|
193
|
+
),
|
|
194
|
+
);
|
|
195
|
+
},
|
|
196
|
+
videoSegmentation: states.effects,
|
|
197
|
+
foregroundThreshold: states.foregroundThreshold,
|
|
198
|
+
backgroundBlurAmount: states.backgroundBlurAmount,
|
|
199
|
+
maskCombineRatio: states.maskCombineRatio,
|
|
200
|
+
backgroundImageUrl: states.backgroundImageUrl,
|
|
201
|
+
processingWidth: 640,
|
|
202
|
+
processingHeight: 480,
|
|
215
203
|
});
|
|
216
204
|
|
|
217
205
|
// Instantiate the media object
|
package/api-docs/README.mdx
CHANGED
|
@@ -11,7 +11,7 @@ create a streamlined media process
|
|
|
11
11
|
|
|
12
12
|
### `createMedia`
|
|
13
13
|
|
|
14
|
-
It
|
|
14
|
+
It creates an object to interact with the media stream, which is usually used
|
|
15
15
|
for our main stream.
|
|
16
16
|
|
|
17
17
|
Its major features:
|
|
@@ -67,11 +67,6 @@ export interface InputConstraintSet extends MediaTrackConstraints {
|
|
|
67
67
|
* segment. Available effects are `none`, `blur`, `overlay` or `remove`
|
|
68
68
|
*/
|
|
69
69
|
videoSegmentation?: ConstrainDOMString;
|
|
70
|
-
/**
|
|
71
|
-
* Segmentation model to be used for video segmentation, currently only
|
|
72
|
-
* supports `mediapipeSelfie` and `personify`
|
|
73
|
-
*/
|
|
74
|
-
videoSegmentationModel?: ConstrainDOMString;
|
|
75
70
|
/**
|
|
76
71
|
* Whether or not using our own noise suppression
|
|
77
72
|
*/
|
|
@@ -133,12 +128,8 @@ export interface InputConstraintSet extends MediaTrackConstraints {
|
|
|
133
128
|
|
|
134
129
|
```typescript
|
|
135
130
|
import {createMedia, createMediaSignals, UserMediaStatus} from '@pexip/media';
|
|
136
|
-
import type {RenderEffects,
|
|
137
|
-
import {
|
|
138
|
-
createSegmenter,
|
|
139
|
-
createCanvasTransform,
|
|
140
|
-
createVideoProcessor,
|
|
141
|
-
} from '@pexip/media-processor';
|
|
131
|
+
import type {RenderEffects, Media} from '@pexip/media';
|
|
132
|
+
import {createSegmenter, createVideoProcessor} from '@pexip/media-processor';
|
|
142
133
|
|
|
143
134
|
// App states
|
|
144
135
|
const states: {
|
|
@@ -186,32 +177,29 @@ const modelAsset = {
|
|
|
186
177
|
modelName: 'selfie' as const,
|
|
187
178
|
};
|
|
188
179
|
|
|
189
|
-
const
|
|
190
|
-
// Create a processing transformer and set the effects to `blur`
|
|
191
|
-
const transformer = createCanvasTransform(segmenter, {
|
|
192
|
-
effects: states.effects,
|
|
193
|
-
foregroundThreshold: states.foregroundThreshold,
|
|
194
|
-
backgroundBlurAmount: states.backgroundBlurAmount,
|
|
195
|
-
maskCombineRatio: states.maskCombineRatio,
|
|
196
|
-
backgroundImageUrl: states.backgroundImageUrl,
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
const selfie = createSegmenter(taskVisionBasePath, {
|
|
180
|
+
const selfie = createSegmenter(tasksVisionBasePath, {
|
|
200
181
|
modelAsset,
|
|
201
182
|
delegate: () => 'GPU', // Use GPU
|
|
202
183
|
});
|
|
203
184
|
|
|
204
|
-
export const segmenters: Partial<Segmenters> = {
|
|
205
|
-
selfie,
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
const videoProcessor = createVideoProcessor([transformer]);
|
|
209
|
-
|
|
210
185
|
const videoStreamProcessor = createVideoStreamProcess({
|
|
211
186
|
shouldEnable: () => true, // Always Process Video Track
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
187
|
+
getVideoProcessor: () => {
|
|
188
|
+
return createVideoProcessor(
|
|
189
|
+
selfie,
|
|
190
|
+
getDefaultInputProcessAdaptor(
|
|
191
|
+
chooseVideoProcessorAPI() === 'stream',
|
|
192
|
+
FRAME_RATE,
|
|
193
|
+
),
|
|
194
|
+
);
|
|
195
|
+
},
|
|
196
|
+
videoSegmentation: states.effects,
|
|
197
|
+
foregroundThreshold: states.foregroundThreshold,
|
|
198
|
+
backgroundBlurAmount: states.backgroundBlurAmount,
|
|
199
|
+
maskCombineRatio: states.maskCombineRatio,
|
|
200
|
+
backgroundImageUrl: states.backgroundImageUrl,
|
|
201
|
+
processingWidth: 640,
|
|
202
|
+
processingHeight: 480,
|
|
215
203
|
});
|
|
216
204
|
|
|
217
205
|
// Instantiate the media object
|
|
@@ -328,12 +316,10 @@ await mediaController.media.applyConstraints({
|
|
|
328
316
|
| [Process](type-aliases/Process.mdx) | - |
|
|
329
317
|
| [TrackProcessor](type-aliases/TrackProcessor.mdx) | - |
|
|
330
318
|
| [GetUserMediaProcess](type-aliases/GetUserMediaProcess.mdx) | - |
|
|
331
|
-
| [VideoStreamTrackProcessorAPIs](type-aliases/VideoStreamTrackProcessorAPIs.mdx) | Use which processor API to process the stream track `stream` - Use `MediaStreamTrackProcessor`, when available `canvas` - Use Canvas |
|
|
332
319
|
| [VideoRenderParams](type-aliases/VideoRenderParams.mdx) | - |
|
|
333
320
|
| [MediaSignalsOptional](type-aliases/MediaSignalsOptional.mdx) | - |
|
|
334
321
|
| [MediaSignalsRequired](type-aliases/MediaSignalsRequired.mdx) | - |
|
|
335
322
|
| [MediaSignals](type-aliases/MediaSignals.mdx) | - |
|
|
336
|
-
| [Segmenters](type-aliases/Segmenters.mdx) | - |
|
|
337
323
|
| [AudioContentHint](type-aliases/AudioContentHint.mdx) | - |
|
|
338
324
|
| [VideoContentHint](type-aliases/VideoContentHint.mdx) | - |
|
|
339
325
|
|
|
@@ -399,7 +385,6 @@ await mediaController.media.applyConstraints({
|
|
|
399
385
|
| [isAnalyzerNodeInitProp](functions/isAnalyzerNodeInitProp.mdx) | - |
|
|
400
386
|
| [isAudioContentHint](functions/isAudioContentHint.mdx) | - |
|
|
401
387
|
| [isVideoContentHint](functions/isVideoContentHint.mdx) | - |
|
|
402
|
-
| [isVideoStreamTrackProcessorAPIs](functions/isVideoStreamTrackProcessorAPIs.mdx) | - |
|
|
403
388
|
| [getBlurKernelSize](functions/getBlurKernelSize.mdx) | A function to get the blur kernel size of image height based on Kawase blur algorithm |
|
|
404
389
|
| [getTentBlurSize](functions/getTentBlurSize.mdx) | A function to get the Tent blur size of image height |
|
|
405
390
|
| [applyContentHint](functions/applyContentHint.mdx) | Apply the content hint to the track |
|
|
@@ -8,7 +8,7 @@ Apply the content hint to the track
|
|
|
8
8
|
|
|
9
9
|
| Type Parameter |
|
|
10
10
|
| ------ |
|
|
11
|
-
| `T
|
|
11
|
+
| `T extends \| "" \| "speech" \| "speech-recognition" \| "music" \| "motion" \| "detail" \| "text"` |
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -11,7 +11,7 @@ Create an Audio Mixing Processor and will own the stream passed-in
|
|
|
11
11
|
|
|
12
12
|
| Parameter | Type | Default value |
|
|
13
13
|
| ------ | ------ | ------ |
|
|
14
|
-
| `getCurrentMedia` | () =>
|
|
14
|
+
| `getCurrentMedia` | `() => MediaStream \| undefined` | `undefined` |
|
|
15
15
|
| `signals?` | [`MediaSignals`](../type-aliases/MediaSignals.mdx) | `undefined` |
|
|
16
16
|
| `label?` | `"AudioMixingProcessor"` | `PROCESSOR_LABELS.AudioMixingProcessor` |
|
|
17
17
|
|
|
@@ -6,8 +6,8 @@ function createGetDisplayMedia(getDefaultConstraints, getDisplayMedia): (constra
|
|
|
6
6
|
|
|
7
7
|
| Parameter | Type |
|
|
8
8
|
| ------ | ------ |
|
|
9
|
-
| `getDefaultConstraints` | () =>
|
|
10
|
-
| `getDisplayMedia` | (
|
|
9
|
+
| `getDefaultConstraints` | `() => DisplayMediaOptions` |
|
|
10
|
+
| `getDisplayMedia` | `(options?) => Promise<MediaStream>` |
|
|
11
11
|
|
|
12
12
|
## Returns
|
|
13
13
|
|
|
@@ -23,4 +23,4 @@ function createGetDisplayMedia(getDefaultConstraints, getDisplayMedia): (constra
|
|
|
23
23
|
|
|
24
24
|
### Returns
|
|
25
25
|
|
|
26
|
-
`Promise
|
|
26
|
+
`Promise<MediaStream | undefined>`
|
|
@@ -19,11 +19,11 @@ Create a general signal with consistent scoped name
|
|
|
19
19
|
| ------ | ------ | ------ | ------ |
|
|
20
20
|
| `name` | `string` | `undefined` | Signal name |
|
|
21
21
|
| `crucial` | `boolean` | `true` | Signify if the signal is unmissable. |
|
|
22
|
-
| `variant` | `"generic"
|
|
22
|
+
| `variant` | `"generic" \| "behavior" \| "replay"` | `'generic'` | The variant of the signal |
|
|
23
23
|
|
|
24
24
|
## Returns
|
|
25
25
|
|
|
26
|
-
`Signal
|
|
26
|
+
`Signal<T, T>`
|
|
27
27
|
|
|
28
28
|
## Default Value
|
|
29
29
|
|
|
@@ -9,18 +9,20 @@ signals for media to work
|
|
|
9
9
|
|
|
10
10
|
| Type Parameter |
|
|
11
11
|
| ------ |
|
|
12
|
-
| `K
|
|
12
|
+
| `K extends \| "onAddTrack" \| "onDevicesChanged" \| "onMediaTrackMuted" \| "onMediaTrackResumed" \| "onMediaTrackStopped" \| "onMediaTrackSuspended" \| "onRemoveTrack" \| "onStatusChanged" \| "onUpdatingAudio" \| "onUpdatingVideo"` |
|
|
13
13
|
|
|
14
14
|
## Parameters
|
|
15
15
|
|
|
16
16
|
| Parameter | Type | Default value | Description |
|
|
17
17
|
| ------ | ------ | ------ | ------ |
|
|
18
|
-
| `more` | `K
|
|
18
|
+
| `more` | `K[]` | `undefined` | Keys from `MediaSignalsOptional`, |
|
|
19
19
|
| `scope` | `string` | `''` | any scope prefix for the generated signal name, |
|
|
20
20
|
|
|
21
21
|
## Returns
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
```ts
|
|
24
|
+
Pick<Required<MediaSignals>, SignalKeys>
|
|
25
|
+
```
|
|
24
26
|
|
|
25
27
|
## See
|
|
26
28
|
|
|
@@ -7,8 +7,10 @@ function deriveInitialPermissionStatus(prevStatus, getPermissionState): Promise<
|
|
|
7
7
|
| Parameter | Type | Default value |
|
|
8
8
|
| ------ | ------ | ------ |
|
|
9
9
|
| `prevStatus` | [`UserMediaStatus`](../enumerations/UserMediaStatus.mdx) | `undefined` |
|
|
10
|
-
| `getPermissionState` | (
|
|
10
|
+
| `getPermissionState` | `(anyActiveAudioTrack?, anyActiveVideoTrack?, getDevices?) => Promise<InputDevicePermission>` | `getInputDevicePermissionState` |
|
|
11
11
|
|
|
12
12
|
## Returns
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
```ts
|
|
15
|
+
Promise<UserMediaStatus>
|
|
16
|
+
```
|
|
@@ -16,19 +16,39 @@ function getPermissionStatus(__namedParameters):
|
|
|
16
16
|
|
|
17
17
|
| Parameter | Type |
|
|
18
18
|
| ------ | ------ |
|
|
19
|
-
| `__namedParameters` |
|
|
19
|
+
| `__namedParameters` | `{ audio: PermissionState; video: PermissionState; }` |
|
|
20
20
|
| `__namedParameters.audio` | `PermissionState` |
|
|
21
21
|
| `__namedParameters.video` | `PermissionState` |
|
|
22
22
|
|
|
23
23
|
## Returns
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
```ts
|
|
26
|
+
| Initial
|
|
27
|
+
```
|
|
28
|
+
```ts
|
|
29
|
+
| InitialPermissionsGranted
|
|
30
|
+
```
|
|
31
|
+
```ts
|
|
32
|
+
| InitialPermissionsNotGranted
|
|
33
|
+
```
|
|
34
|
+
```ts
|
|
35
|
+
| InitialPermissionsVideoInputDenied
|
|
36
|
+
```
|
|
37
|
+
```ts
|
|
38
|
+
| InitialPermissionsAudioInputDenied
|
|
39
|
+
```
|
|
40
|
+
```ts
|
|
41
|
+
| InitialPermissionsVideoInputGranted
|
|
42
|
+
```
|
|
43
|
+
```ts
|
|
44
|
+
| InitialPermissionsAudioInputGranted
|
|
45
|
+
```
|
|
46
|
+
```ts
|
|
47
|
+
| InitialPermissionsGrantedVideoInputDenied
|
|
48
|
+
```
|
|
49
|
+
```ts
|
|
50
|
+
| InitialPermissionsGrantedAudioInputDenied
|
|
51
|
+
```
|
|
52
|
+
```ts
|
|
53
|
+
| PermissionsRejected
|
|
54
|
+
```
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
| Property | Type |
|
|
4
4
|
| ------ | ------ |
|
|
5
|
-
| <a id="onvad"></a> `onVAD` | `Signal
|
|
6
|
-
| <a id="onsilentdetected"></a> `onSilentDetected` | `Signal
|
|
5
|
+
| <a id="onvad"></a> `onVAD` | `Signal<undefined>` |
|
|
6
|
+
| <a id="onsilentdetected"></a> `onSilentDetected` | `Signal<boolean>` |
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
| Property | Type | Description |
|
|
4
4
|
| ------ | ------ | ------ |
|
|
5
5
|
| <a id="audiosignaldetectionduration"></a> `audioSignalDetectionDuration?` | `number` | Audio Signal Detection Duration in second |
|
|
6
|
-
| <a id="shoulddetectaudio"></a> `shouldDetectAudio` | () =>
|
|
6
|
+
| <a id="shoulddetectaudio"></a> `shouldDetectAudio` | `() => boolean` | Whether or not to detect audio signal for malfunctioning device |
|
|
@@ -16,18 +16,20 @@
|
|
|
16
16
|
| <a id="edgebluramount"></a> `edgeBlurAmount?` | `number` | - | - |
|
|
17
17
|
| <a id="maskcombineratio"></a> `maskCombineRatio?` | `number` | - | - |
|
|
18
18
|
| <a id="foregroundthreshold"></a> `foregroundThreshold?` | `number` | - | - |
|
|
19
|
-
| <a id="videosegmentation"></a> `videoSegmentation?` | `"none"
|
|
20
|
-
| <a id="
|
|
21
|
-
| <a id="
|
|
22
|
-
| <a id="
|
|
23
|
-
| <a id="
|
|
24
|
-
| <a id="
|
|
19
|
+
| <a id="videosegmentation"></a> `videoSegmentation?` | `"none" \| "blur" \| "overlay"` | - | - |
|
|
20
|
+
| <a id="panenabled"></a> `panEnabled?` | `boolean` | - | - |
|
|
21
|
+
| <a id="tiltenabled"></a> `tiltEnabled?` | `boolean` | - | - |
|
|
22
|
+
| <a id="zoomenabled"></a> `zoomEnabled?` | `boolean` | - | - |
|
|
23
|
+
| <a id="pan"></a> `pan?` | `number` | - | - |
|
|
24
|
+
| <a id="tilt"></a> `tilt?` | `number` | - | - |
|
|
25
|
+
| <a id="zoom"></a> `zoom?` | `number` | `MediaTrackSettings.zoom` | - |
|
|
26
|
+
| <a id="contenthint"></a> `contentHint?` | `\| "" \| "speech" \| "speech-recognition" \| "music" \| "motion" \| "detail" \| "text"` | - | - |
|
|
25
27
|
| <a id="aspectratio"></a> `aspectRatio?` | `number` | - | `MediaTrackSettings.aspectRatio` |
|
|
26
28
|
| <a id="autogaincontrol"></a> `autoGainControl?` | `boolean` | - | `MediaTrackSettings.autoGainControl` |
|
|
27
29
|
| <a id="backgroundblur"></a> `backgroundBlur?` | `boolean` | - | `MediaTrackSettings.backgroundBlur` |
|
|
28
30
|
| <a id="deviceid"></a> `deviceId?` | `string` | - | `MediaTrackSettings.deviceId` |
|
|
29
31
|
| <a id="displaysurface"></a> `displaySurface?` | `string` | - | `MediaTrackSettings.displaySurface` |
|
|
30
|
-
| <a id="echocancellation"></a> `echoCancellation?` | `boolean` | - | `MediaTrackSettings.echoCancellation` |
|
|
32
|
+
| <a id="echocancellation"></a> `echoCancellation?` | `string \| boolean` | - | `MediaTrackSettings.echoCancellation` |
|
|
31
33
|
| <a id="facingmode"></a> `facingMode?` | `string` | - | `MediaTrackSettings.facingMode` |
|
|
32
34
|
| <a id="framerate"></a> `frameRate?` | `number` | - | `MediaTrackSettings.frameRate` |
|
|
33
35
|
| <a id="groupid"></a> `groupId?` | `string` | - | `MediaTrackSettings.groupId` |
|
|
@@ -35,4 +37,6 @@
|
|
|
35
37
|
| <a id="noisesuppression"></a> `noiseSuppression?` | `boolean` | - | `MediaTrackSettings.noiseSuppression` |
|
|
36
38
|
| <a id="samplerate"></a> `sampleRate?` | `number` | - | `MediaTrackSettings.sampleRate` |
|
|
37
39
|
| <a id="samplesize"></a> `sampleSize?` | `number` | - | `MediaTrackSettings.sampleSize` |
|
|
40
|
+
| <a id="torch"></a> `torch?` | `boolean` | - | `MediaTrackSettings.torch` |
|
|
41
|
+
| <a id="whitebalancemode"></a> `whiteBalanceMode?` | `string` | - | `MediaTrackSettings.whiteBalanceMode` |
|
|
38
42
|
| <a id="width"></a> `width?` | `number` | - | `MediaTrackSettings.width` |
|
|
@@ -13,8 +13,8 @@
|
|
|
13
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
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
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
|
|
17
|
-
| <a id="videomuted"></a> `videoMuted` | `public` | `boolean
|
|
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
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
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
20
|
|
|
@@ -76,7 +76,7 @@ Apply the constraints to the current media
|
|
|
76
76
|
|
|
77
77
|
#### Returns
|
|
78
78
|
|
|
79
|
-
`Promise
|
|
79
|
+
`Promise<void>`
|
|
80
80
|
|
|
81
81
|
***
|
|
82
82
|
|
|
@@ -90,7 +90,7 @@ Release the media resources, e.g. camera/microphone
|
|
|
90
90
|
|
|
91
91
|
#### Returns
|
|
92
92
|
|
|
93
|
-
`Promise
|
|
93
|
+
`Promise<void>`
|
|
94
94
|
|
|
95
95
|
***
|
|
96
96
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
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
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
15
|
| <a id="status"></a> `status` | `public` | [`UserMediaStatus`](../enumerations/UserMediaStatus.mdx) | The status of the media |
|
|
16
|
-
| <a id="audiomuted"></a> `audioMuted` | `public` | `boolean
|
|
17
|
-
| <a id="videomuted"></a> `videoMuted` | `public` | `boolean
|
|
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
18
|
| <a id="audioinput"></a> `audioInput?` | `public` | `MediaDeviceInfoLike` | Audio input device is used for the audio track from the current stream |
|
|
19
19
|
| <a id="videoinput"></a> `videoInput?` | `public` | `MediaDeviceInfoLike` | Video input device is used for the video track from the current stream |
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
| Property | Type |
|
|
4
4
|
| ------ | ------ |
|
|
5
|
-
| <a id="onaddtrack"></a> `onAddTrack` | `Signal
|
|
6
|
-
| <a id="ondeviceschanged"></a> `onDevicesChanged` | `Signal
|
|
5
|
+
| <a id="onaddtrack"></a> `onAddTrack` | `Signal<MediaStreamTrack>` |
|
|
6
|
+
| <a id="ondeviceschanged"></a> `onDevicesChanged` | `Signal<IndexedDevices>` |
|
|
7
7
|
| <a id="onmediachanged"></a> `onMediaChanged` | `Signal`\<[`Media`](Media.mdx) \| `undefined`\> |
|
|
8
8
|
| <a id="onmediatrackmuted"></a> `onMediaTrackMuted` | `Signal`\<[`MediaTrack`](MediaTrack.mdx)\> |
|
|
9
9
|
| <a id="onmediatrackresumed"></a> `onMediaTrackResumed` | `Signal`\<[`MediaTrack`](MediaTrack.mdx)\> |
|
|
10
10
|
| <a id="onmediatrackstopped"></a> `onMediaTrackStopped` | `Signal`\<[`MediaTrack`](MediaTrack.mdx)\> |
|
|
11
11
|
| <a id="onmediatracksuspended"></a> `onMediaTrackSuspended` | `Signal`\<[`MediaTrack`](MediaTrack.mdx)\> |
|
|
12
|
-
| <a id="onremovetrack"></a> `onRemoveTrack` | `Signal
|
|
12
|
+
| <a id="onremovetrack"></a> `onRemoveTrack` | `Signal<MediaStreamTrack>` |
|
|
13
13
|
| <a id="onstatuschanged"></a> `onStatusChanged` | `Signal`\<[`UserMediaStatus`](../enumerations/UserMediaStatus.mdx)\> |
|
|
14
|
-
| <a id="onupdatingaudio"></a> `onUpdatingAudio` | `Signal
|
|
15
|
-
| <a id="onupdatingvideo"></a> `onUpdatingVideo` | `Signal
|
|
14
|
+
| <a id="onupdatingaudio"></a> `onUpdatingAudio` | `Signal<boolean>` |
|
|
15
|
+
| <a id="onupdatingvideo"></a> `onUpdatingVideo` | `Signal<boolean>` |
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
| <a id="updatingvideo"></a> `updatingVideo` | `readonly` | `boolean` | - |
|
|
7
7
|
| <a id="media"></a> `media?` | `readonly` | [`Media`](Media.mdx) | Current Media |
|
|
8
8
|
| <a id="devices"></a> `devices` | `readonly` | `IndexedDevices` | Current device list |
|
|
9
|
-
| <a id="getusermedia"></a> `getUserMedia` | `public` | (
|
|
10
|
-
| <a id="getusermediaasync"></a> `getUserMediaAsync` | `public` | (
|
|
11
|
-
| <a id="tryandgetusermedia"></a> `tryAndGetUserMedia` | `public` | (
|
|
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. |
|
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
| <a id="tracks"></a> `tracks` | [`MediaTrack`](MediaTrack.mdx)[] |
|
|
11
11
|
| <a id="devices"></a> `devices` | `IndexedDevices` |
|
|
12
12
|
| <a id="status"></a> `status` | [`UserMediaStatus`](../enumerations/UserMediaStatus.mdx) |
|
|
13
|
-
| <a id="stream"></a> `stream` | `MediaStream
|
|
13
|
+
| <a id="stream"></a> `stream` | `MediaStream \| undefined` |
|
|
14
14
|
| <a id="signals"></a> `signals?` | [`MediaSignals`](../type-aliases/MediaSignals.mdx) |
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
| <a id="signals"></a> `signals` | [`MediaSignals`](../type-aliases/MediaSignals.mdx) | Media signals to be used for the module **See** MediaSignals |
|
|
6
6
|
| <a id="audioprocessors"></a> `audioProcessors` | [`TrackProcessor`](../type-aliases/TrackProcessor.mdx)[] | Media Processors |
|
|
7
7
|
| <a id="videoprocessors"></a> `videoProcessors` | [`TrackProcessor`](../type-aliases/TrackProcessor.mdx)[] | - |
|
|
8
|
-
| <a id="stopvideotrackasmute"></a> `stopVideoTrackAsMute?` | () =>
|
|
9
|
-
| <a id="getmutestate"></a> `getMuteState` | () =>
|
|
10
|
-
| <a id="getdefaultconstraints"></a> `getDefaultConstraints?` | () =>
|
|
8
|
+
| <a id="stopvideotrackasmute"></a> `stopVideoTrackAsMute?` | `() => boolean` | - |
|
|
9
|
+
| <a id="getmutestate"></a> `getMuteState` | `() => DeviceMuteState` | A function to get the devices' mute state |
|
|
10
|
+
| <a id="getdefaultconstraints"></a> `getDefaultConstraints?` | `() => object` | Pass default constraints to use with get media wrappers |
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
| <a id="id"></a> `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 |
|
|
6
6
|
| <a id="stopped"></a> `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 |
|
|
7
7
|
| <a id="suspended"></a> `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 |
|
|
8
|
-
| <a id="kind"></a> `kind` | `readonly` | `"audioinput"
|
|
8
|
+
| <a id="kind"></a> `kind` | `readonly` | `"audioinput" \| "videoinput"` | - |
|
|
9
9
|
| <a id="label"></a> `label?` | `readonly` | `string` | - |
|
|
10
10
|
| <a id="previousmediatrack"></a> `previousMediaTrack?` | `readonly` | `MediaTrack` | - |
|
|
11
11
|
| <a id="track"></a> `track?` | `readonly` | `MediaStreamTrack` | The MediaStreamTrack object representing the track **See** https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack |
|
|
@@ -75,7 +75,7 @@ applyConstraints(constraints): Promise<void>;
|
|
|
75
75
|
|
|
76
76
|
#### Returns
|
|
77
77
|
|
|
78
|
-
`Promise
|
|
78
|
+
`Promise<void>`
|
|
79
79
|
|
|
80
80
|
***
|
|
81
81
|
|
|
@@ -87,7 +87,7 @@ release(): Promise<void>;
|
|
|
87
87
|
|
|
88
88
|
#### Returns
|
|
89
89
|
|
|
90
|
-
`Promise
|
|
90
|
+
`Promise<void>`
|
|
91
91
|
|
|
92
92
|
***
|
|
93
93
|
|