@pexip/media 20.3.4 → 21.0.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 +71 -0
- package/api-docs/README.mdx +406 -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/getBlurKernelSize.mdx +25 -0
- package/api-docs/functions/getPermissionStatus.mdx +34 -0
- package/api-docs/functions/getTentBlurSize.mdx +24 -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 +17 -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/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/previewController.js +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/userMedia.d.ts +4 -1
- package/dist/userMedia.js +15 -11
- package/dist/utils.d.ts +17 -6
- package/dist/utils.js +27 -13
- package/dist/videoProcessor.d.ts +3 -3
- package/dist/videoProcessor.js +172 -30
- package/package.json +17 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# @pexip/media
|
|
2
2
|
|
|
3
|
+
## 21.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 2606fa4: Fix blur normalize function
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 1786b2d: Get correct stream status when only one input kind is requested
|
|
12
|
+
- a004e3c: Introduce new `renderParams` that can be applied via the video
|
|
13
|
+
constraints:
|
|
14
|
+
- `backgroundThreshold` - Segmentation threshold for classifying pixels as
|
|
15
|
+
background (lower values include more background).
|
|
16
|
+
- `downSampleFactor` - Factor for downsampling the video frame before
|
|
17
|
+
processing (higher values improve performance but reduce quality).
|
|
18
|
+
- `lightWrapBlurAmount` - Amount of blur applied to the light wrap effect
|
|
19
|
+
around the subject's edges.
|
|
20
|
+
- `lightWrapEdgeBand` - Width of the edge band in pixels where the light wrap
|
|
21
|
+
effect is applied.
|
|
22
|
+
- `lightWrapIntensity` - Intensity/strength of the light wrap effect (0.0 to
|
|
23
|
+
1.0).
|
|
24
|
+
- `lightWrapTightness` - Controls how tightly the light wrap effect hugs the
|
|
25
|
+
subject's edges.
|
|
26
|
+
- `morphDilateRadiusPx` - Radius in pixels for morphological dilation
|
|
27
|
+
operation on the segmentation mask.
|
|
28
|
+
- `morphErodeRadiusPx` - Radius in pixels for morphological erosion operation
|
|
29
|
+
on the segmentation mask.
|
|
30
|
+
- `morphPass` - Number of morphological filter passes to apply for mask
|
|
31
|
+
refinement.
|
|
32
|
+
- `personCenterX` - X-coordinate (0.0 to 1.0) of the expected center position
|
|
33
|
+
of the person in the frame for segmentation optimization.
|
|
34
|
+
- `personCenterY` - Y-coordinate (0.0 to 1.0) of the expected center position
|
|
35
|
+
of the person in the frame for segmentation optimization.
|
|
36
|
+
- `sigmaRangeHi` - Bilateral filter: upper bound of sigma in color space for
|
|
37
|
+
edge-preserving smoothing.
|
|
38
|
+
- `sigmaRangeLo` - Bilateral filter: lower bound of sigma in color space for
|
|
39
|
+
edge-preserving smoothing.
|
|
40
|
+
- `sigmaSpace` - Bilateral filter: sigma in pixel space for mask edge
|
|
41
|
+
snapping.
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- c10f5b6: Normalise initial `lightWrapBlurAmount` and `edgeBlurAmount` values
|
|
46
|
+
- Updated dependencies [24bc717]
|
|
47
|
+
- Updated dependencies [1786b2d]
|
|
48
|
+
- Updated dependencies [872971f]
|
|
49
|
+
- Updated dependencies [2e895ac]
|
|
50
|
+
- Updated dependencies [3963c2e]
|
|
51
|
+
- Updated dependencies [1fff975]
|
|
52
|
+
- Updated dependencies [3963c2e]
|
|
53
|
+
- Updated dependencies [762ebd2]
|
|
54
|
+
- Updated dependencies [4eaf9d7]
|
|
55
|
+
- Updated dependencies [4d2da34]
|
|
56
|
+
- Updated dependencies [a004e3c]
|
|
57
|
+
- Updated dependencies [4cc4701]
|
|
58
|
+
- @pexip/media-processor@21.0.0
|
|
59
|
+
- @pexip/media-control@21.0.0
|
|
60
|
+
- @pexip/utils@17.2.0
|
|
61
|
+
- @pexip/signal@16.9.4
|
|
62
|
+
|
|
63
|
+
## 20.3.5
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- 13e3722: Generate the package documentation in a folder called doc-dist
|
|
68
|
+
- Updated dependencies [13e3722]
|
|
69
|
+
- @pexip/media-processor@20.3.5
|
|
70
|
+
- @pexip/media-control@20.3.5
|
|
71
|
+
- @pexip/signal@16.9.3
|
|
72
|
+
- @pexip/utils@17.1.3
|
|
73
|
+
|
|
3
74
|
## 20.3.4
|
|
4
75
|
|
|
5
76
|
### Patch Changes
|
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
# `@pexip/media`
|
|
2
|
+
|
|
3
|
+
A package to connect `@pexip/media-control` and `@pexip/media-processor` to
|
|
4
|
+
create a streamlined media process
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
`npm install @pexip/media`
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
### `createMedia`
|
|
13
|
+
|
|
14
|
+
It create's an object to interact with the media stream, which is usually used
|
|
15
|
+
for our main stream.
|
|
16
|
+
|
|
17
|
+
Its major features:
|
|
18
|
+
|
|
19
|
+
- Create a media pipeline to get and process the `MediaStream`, see
|
|
20
|
+
`createMediaPipeline`. It also provides some media features including:
|
|
21
|
+
|
|
22
|
+
- Video Processing - background blur
|
|
23
|
+
- Audio Processing - Noise Suppression
|
|
24
|
+
- Audio Signal Detection - To detect if the active audio input device is
|
|
25
|
+
capturing any audio
|
|
26
|
+
- Voice Activity Detection - To detect if there is any voice activity
|
|
27
|
+
|
|
28
|
+
- Provide media input related information
|
|
29
|
+
- Verify if we need to request a new `MediaStream`, see `updateMedia`
|
|
30
|
+
- Subscribe events from `@pexip/media-control` and update the state accordingly
|
|
31
|
+
|
|
32
|
+
### `createAudioStreamProcess`
|
|
33
|
+
|
|
34
|
+
A processor to process audio from the stream to be used together with
|
|
35
|
+
`createMedia` as one of the media processor of the pipeline.
|
|
36
|
+
|
|
37
|
+
### `createVideoStreamProcess`
|
|
38
|
+
|
|
39
|
+
A processor to process video from the stream to be used together with
|
|
40
|
+
`createMedia` as one of the media processor of the pipeline.
|
|
41
|
+
|
|
42
|
+
### `createPreviewController`
|
|
43
|
+
|
|
44
|
+
It creates an object to control the provided media stream, e.g. change the
|
|
45
|
+
audio/video input device and apply changes to the main stream when necessary.
|
|
46
|
+
|
|
47
|
+
## Usage
|
|
48
|
+
|
|
49
|
+
The package tries to follow the
|
|
50
|
+
[MediaStream API's Constraints pattern](https://developer.mozilla.org/en-US/docs/Web/API/Media_Streams_API/Constraints).
|
|
51
|
+
Beside the
|
|
52
|
+
[MediaTrackConstraintSet](https://w3c.github.io/mediacapture-main/#dictionary-mediatrackconstraints-members)
|
|
53
|
+
that's specified from the
|
|
54
|
+
[Media Capture and Streams](https://w3c.github.io/mediacapture-main) spec, we
|
|
55
|
+
have extended some additional media features as the following:
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
export interface InputConstraintSet extends MediaTrackConstraints {
|
|
59
|
+
/**
|
|
60
|
+
* Same purpose as `deviceId` but it gives more information about the device
|
|
61
|
+
* so that we can have extra tolerance on device selection
|
|
62
|
+
*/
|
|
63
|
+
device?: DeviceConstraint | ConstraintDeviceParameters;
|
|
64
|
+
/**
|
|
65
|
+
* Whether or not using video segmentation, e.g. background
|
|
66
|
+
* blur/replacement, to specify the effects, intended to be applied to the
|
|
67
|
+
* segment. Available effects are `none`, `blur`, `overlay` or `remove`
|
|
68
|
+
*/
|
|
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
|
+
/**
|
|
76
|
+
* Whether or not using our own noise suppression
|
|
77
|
+
*/
|
|
78
|
+
denoise?: ConstrainBoolean;
|
|
79
|
+
/**
|
|
80
|
+
* Voice Activity Detection
|
|
81
|
+
*/
|
|
82
|
+
vad?: ConstrainBoolean;
|
|
83
|
+
/**
|
|
84
|
+
* Audio Signal Detection for the purpose of checking if the audio input is
|
|
85
|
+
* hardware muted or unusable
|
|
86
|
+
*/
|
|
87
|
+
asd?: ConstrainBoolean;
|
|
88
|
+
/**
|
|
89
|
+
* Audio Signal Detection for the purpose of checking if the audio input is
|
|
90
|
+
* hardware muted or unusable
|
|
91
|
+
*/
|
|
92
|
+
mixWithAdditionalMedia?: ConstrainBoolean;
|
|
93
|
+
/**
|
|
94
|
+
* Blur size/level parameter when using video segmentation with `blur`
|
|
95
|
+
* effects
|
|
96
|
+
*/
|
|
97
|
+
backgroundBlurAmount?: ConstrainULong;
|
|
98
|
+
/**
|
|
99
|
+
* Blur amount applied to the segmented person's edge
|
|
100
|
+
*/
|
|
101
|
+
edgeBlurAmount?: ConstrainULong;
|
|
102
|
+
/**
|
|
103
|
+
* Erode level for edge smoothing when using video segmentation
|
|
104
|
+
*/
|
|
105
|
+
foregroundThreshold?: ConstrainDouble;
|
|
106
|
+
/**
|
|
107
|
+
* Image Url that is being used for video overlay effects
|
|
108
|
+
*/
|
|
109
|
+
backgroundImageUrl?: ConstrainDOMString;
|
|
110
|
+
/**
|
|
111
|
+
* The ratio to be used for smoothing segmentation mask
|
|
112
|
+
*/
|
|
113
|
+
maskCombineRatio?: ConstrainDouble;
|
|
114
|
+
/**
|
|
115
|
+
* Image Url that is being used for video overlay effects
|
|
116
|
+
*/
|
|
117
|
+
resizeMode?: ConstrainDOMString;
|
|
118
|
+
/**
|
|
119
|
+
* Current pan, tilt and zoom level for a PTZ controllable camera on web
|
|
120
|
+
*/
|
|
121
|
+
pan?: boolean;
|
|
122
|
+
tilt?: boolean;
|
|
123
|
+
zoom?: boolean;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Content Hint for the track to apply
|
|
127
|
+
*/
|
|
128
|
+
contentHint?: ConstrainDOMString;
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### `createMedia`
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
import {createMedia, createMediaSignals, UserMediaStatus} from '@pexip/media';
|
|
136
|
+
import type {RenderEffects, Segmenters, Media} from '@pexip/media';
|
|
137
|
+
import {
|
|
138
|
+
createSegmenter,
|
|
139
|
+
createCanvasTransform,
|
|
140
|
+
createVideoProcessor,
|
|
141
|
+
} from '@pexip/media-processor';
|
|
142
|
+
|
|
143
|
+
// App states
|
|
144
|
+
const states: {
|
|
145
|
+
muted: {video: boolean; audio: boolean};
|
|
146
|
+
effects: RenderEffects;
|
|
147
|
+
foregroundThreshold: number;
|
|
148
|
+
backgroundBlurAmount: number;
|
|
149
|
+
maskCombineRatio: number;
|
|
150
|
+
backgroundImageUrl: string;
|
|
151
|
+
media?: Media;
|
|
152
|
+
status: UserMediaStatus;
|
|
153
|
+
} = {
|
|
154
|
+
muted: {
|
|
155
|
+
audio: false,
|
|
156
|
+
video: false,
|
|
157
|
+
},
|
|
158
|
+
// Could be `none`, `blur` or `overlay`
|
|
159
|
+
effects: 'none',
|
|
160
|
+
foregroundThreshold: 0.5, // 0.0 - 1.0
|
|
161
|
+
backgroundBlurAmount: 30, // 0 - 100
|
|
162
|
+
maskCombineRatio: 0.5, // 0.0 - 1.0
|
|
163
|
+
backgroundImageUrl: '/some/path/to/an/image/for/background/replacement.png',
|
|
164
|
+
status: UserMediaStatus.Initial,
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// Create required signals with additional `onDevicesChanged`,
|
|
168
|
+
// `onStatusChanged` and `onStreamTrackEnabled` signals
|
|
169
|
+
export const signals = createMediaSignals('demo', [
|
|
170
|
+
'onDevicesChanged',
|
|
171
|
+
'onStatusChanged',
|
|
172
|
+
'onStreamTrackEnabled',
|
|
173
|
+
]);
|
|
174
|
+
|
|
175
|
+
// Setting the path to that `@mediapipe/tasks-vision` assets
|
|
176
|
+
// It will be passed direct to
|
|
177
|
+
// [FilesetResolver.forVisionTasks()](https://ai.google.dev/edge/api/mediapipe/js/tasks-vision.filesetresolver#filesetresolverforvisiontasks)
|
|
178
|
+
const tasksVisionBasePath =
|
|
179
|
+
'A base path to specify the directory the Wasm files should be loaded from';
|
|
180
|
+
|
|
181
|
+
const modelAsset = {
|
|
182
|
+
/**
|
|
183
|
+
* Path to mediapipe selfie segmentation model asset
|
|
184
|
+
*/
|
|
185
|
+
path: 'A path to selfie segmentation model',
|
|
186
|
+
modelName: 'selfie' as const,
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const segmenter = createSegmenter(tasksVisionBasePath, {modelAssets});
|
|
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, {
|
|
200
|
+
modelAsset,
|
|
201
|
+
delegate: () => 'GPU', // Use GPU
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
export const segmenters: Partial<Segmenters> = {
|
|
205
|
+
selfie,
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const videoProcessor = createVideoProcessor([transformer]);
|
|
209
|
+
|
|
210
|
+
const videoStreamProcessor = createVideoStreamProcess({
|
|
211
|
+
shouldEnable: () => true, // Always Process Video Track
|
|
212
|
+
segmenters,
|
|
213
|
+
transformer,
|
|
214
|
+
videoProcessor,
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
// Instantiate the media object
|
|
218
|
+
export const mediaController = createMedia({
|
|
219
|
+
getMuteState: () => states.muted,
|
|
220
|
+
signals,
|
|
221
|
+
audioProcessors: [], // No audio processor
|
|
222
|
+
videoProcessors: [videoStreamProcessor],
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
// Hook-up the signals to get the update
|
|
226
|
+
// Subscribe the onMediaChanged signal to get the latest Media object change event
|
|
227
|
+
signals.onMediaChanged.add(media => {
|
|
228
|
+
states.media = media;
|
|
229
|
+
}); // Assume there is a local function `setLocalMedia`
|
|
230
|
+
// Subscribe the onStatusChanged signal to get the latest Media status change event
|
|
231
|
+
signals.onStatusChanged.add(media => setMediaStatus(media)); // Assume there is a local function `setMediaStatus`
|
|
232
|
+
// Subscribe onStreamTrackEnabled signal to get the MediaStreamTrack['enabled'] change event
|
|
233
|
+
signals.onStreamTrackEnabled.add(track => {
|
|
234
|
+
console.log(track);
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
// Later we can initialize a gUM to get a MediaStream
|
|
238
|
+
mediaController.getUserMedia({
|
|
239
|
+
audio: true,
|
|
240
|
+
video: {
|
|
241
|
+
videoSegmentation: 'blur', // Use background blur
|
|
242
|
+
foregroundThreshold: states.foregroundThreshold,
|
|
243
|
+
backgroundBlurAmount: states.backgroundBlurAmount,
|
|
244
|
+
maskCombineRatio: states.maskCombineRatio,
|
|
245
|
+
backgroundImageUrl: states.backgroundImageUrl,
|
|
246
|
+
},
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
// Access the current `MediaStream`
|
|
250
|
+
mediaController.media.stream;
|
|
251
|
+
// Get audio mute state
|
|
252
|
+
mediaController.media.audioMuted;
|
|
253
|
+
// Mute audio
|
|
254
|
+
mediaController.media.muteAudio(true);
|
|
255
|
+
// Get video mute state
|
|
256
|
+
mediaController.media.videoMuted;
|
|
257
|
+
// Mute video
|
|
258
|
+
mediaController.media.muteVideo(true);
|
|
259
|
+
// Get the status
|
|
260
|
+
mediaController.media.status;
|
|
261
|
+
// Update the status
|
|
262
|
+
mediaController.media.status = UserMediaStatus.Initial;
|
|
263
|
+
// Stop the `MediaStream`
|
|
264
|
+
await mediaController.media.release();
|
|
265
|
+
|
|
266
|
+
// Later we can make changes to the media on-demand without initiating a new gUM call
|
|
267
|
+
|
|
268
|
+
// Turn off background blur
|
|
269
|
+
await mediaController.media.applyConstraints({
|
|
270
|
+
video: {videoSegmentation: 'none'},
|
|
271
|
+
});
|
|
272
|
+
// Turn on background blur
|
|
273
|
+
await mediaController.media.applyConstraints({
|
|
274
|
+
video: {videoSegmentation: 'blur'},
|
|
275
|
+
});
|
|
276
|
+
// Use our own noise suppression
|
|
277
|
+
await mediaController.media.applyConstraints({
|
|
278
|
+
audio: {denoise: true, noiseSuppression: false},
|
|
279
|
+
});
|
|
280
|
+
// Use built-in noise suppression
|
|
281
|
+
await mediaController.media.applyConstraints({
|
|
282
|
+
audio: {denoise: false, noiseSuppression: true},
|
|
283
|
+
});
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## Enumerations
|
|
287
|
+
|
|
288
|
+
| Enumeration | Description |
|
|
289
|
+
| ------ | ------ |
|
|
290
|
+
| [UserMediaStatus](enumerations/UserMediaStatus.mdx) | - |
|
|
291
|
+
| [DeniedDevices](enumerations/DeniedDevices.mdx) | - |
|
|
292
|
+
|
|
293
|
+
## Interfaces
|
|
294
|
+
|
|
295
|
+
| Interface | Description |
|
|
296
|
+
| ------ | ------ |
|
|
297
|
+
| [PreviewEventHandler](interfaces/PreviewEventHandler.mdx) | - |
|
|
298
|
+
| [PreviewStreamParams](interfaces/PreviewStreamParams.mdx) | - |
|
|
299
|
+
| [PreviewControllerProps](interfaces/PreviewControllerProps.mdx) | - |
|
|
300
|
+
| [PreviewStreamController](interfaces/PreviewStreamController.mdx) | - |
|
|
301
|
+
| [ExtendedMediaTrackSettings](interfaces/ExtendedMediaTrackSettings.mdx) | - |
|
|
302
|
+
| [MediaSettings](interfaces/MediaSettings.mdx) | - |
|
|
303
|
+
| [DenoiseParams](interfaces/DenoiseParams.mdx) | URL links needed for creating a denoise node for audio processing |
|
|
304
|
+
| [MediaAttributes](interfaces/MediaAttributes.mdx) | - |
|
|
305
|
+
| [Media](interfaces/Media.mdx) | - |
|
|
306
|
+
| [MediaInit](interfaces/MediaInit.mdx) | - |
|
|
307
|
+
| [MediaTrack](interfaces/MediaTrack.mdx) | - |
|
|
308
|
+
| [MediaTrackInit](interfaces/MediaTrackInit.mdx) | - |
|
|
309
|
+
| [AudioSignalDetectionOptions](interfaces/AudioSignalDetectionOptions.mdx) | - |
|
|
310
|
+
| [VoiceActivityDetectionOptions](interfaces/VoiceActivityDetectionOptions.mdx) | - |
|
|
311
|
+
| [MediaOptions](interfaces/MediaOptions.mdx) | - |
|
|
312
|
+
| [MediaProps](interfaces/MediaProps.mdx) | - |
|
|
313
|
+
| [MediaController](interfaces/MediaController.mdx) | - |
|
|
314
|
+
| [MediaChangesSignals](interfaces/MediaChangesSignals.mdx) | - |
|
|
315
|
+
| [AudioDetectionSignals](interfaces/AudioDetectionSignals.mdx) | - |
|
|
316
|
+
|
|
317
|
+
## Type Aliases
|
|
318
|
+
|
|
319
|
+
| Type Alias | Description |
|
|
320
|
+
| ------ | ------ |
|
|
321
|
+
| [GetDisplayMedia](type-aliases/GetDisplayMedia.mdx) | - |
|
|
322
|
+
| [PreviewInput](type-aliases/PreviewInput.mdx) | - |
|
|
323
|
+
| [CreatePreviewStreamController](type-aliases/CreatePreviewStreamController.mdx) | - |
|
|
324
|
+
| [GeneratedMediaSignals](type-aliases/GeneratedMediaSignals.mdx) | - |
|
|
325
|
+
| [UserMediaValidator](type-aliases/UserMediaValidator.mdx) | - |
|
|
326
|
+
| [Unsubscribe](type-aliases/Unsubscribe.mdx) | - |
|
|
327
|
+
| [ExtendedMediaTrackSettingsKey](type-aliases/ExtendedMediaTrackSettingsKey.mdx) | - |
|
|
328
|
+
| [Process](type-aliases/Process.mdx) | - |
|
|
329
|
+
| [TrackProcessor](type-aliases/TrackProcessor.mdx) | - |
|
|
330
|
+
| [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
|
+
| [VideoRenderParams](type-aliases/VideoRenderParams.mdx) | - |
|
|
333
|
+
| [MediaSignalsOptional](type-aliases/MediaSignalsOptional.mdx) | - |
|
|
334
|
+
| [MediaSignalsRequired](type-aliases/MediaSignalsRequired.mdx) | - |
|
|
335
|
+
| [MediaSignals](type-aliases/MediaSignals.mdx) | - |
|
|
336
|
+
| [Segmenters](type-aliases/Segmenters.mdx) | - |
|
|
337
|
+
| [AudioContentHint](type-aliases/AudioContentHint.mdx) | - |
|
|
338
|
+
| [VideoContentHint](type-aliases/VideoContentHint.mdx) | - |
|
|
339
|
+
|
|
340
|
+
## Variables
|
|
341
|
+
|
|
342
|
+
| Variable | Description |
|
|
343
|
+
| ------ | ------ |
|
|
344
|
+
| [REQUIRED\_SIGNAL\_KEYS](variables/REQUIRED_SIGNAL_KEYS.mdx) | - |
|
|
345
|
+
| [internalSignals](variables/internalSignals.mdx) | Internal signals |
|
|
346
|
+
| [isFallbackVideo](variables/isFallbackVideo.mdx) | - |
|
|
347
|
+
| [isFallbackAudio](variables/isFallbackAudio.mdx) | - |
|
|
348
|
+
| [isFallback](variables/isFallback.mdx) | - |
|
|
349
|
+
| [hasNoDevice](variables/hasNoDevice.mdx) | - |
|
|
350
|
+
| [hasNoAudioDevices](variables/hasNoAudioDevices.mdx) | - |
|
|
351
|
+
| [hasNoVideoDevices](variables/hasNoVideoDevices.mdx) | - |
|
|
352
|
+
| [isGrantedOnlyVideoNoAudioDevices](variables/isGrantedOnlyVideoNoAudioDevices.mdx) | - |
|
|
353
|
+
| [isPromptAudio](variables/isPromptAudio.mdx) | - |
|
|
354
|
+
| [isGrantedOnlyVideo](variables/isGrantedOnlyVideo.mdx) | - |
|
|
355
|
+
| [isGrantedOnlyAudioNoVideoDevices](variables/isGrantedOnlyAudioNoVideoDevices.mdx) | - |
|
|
356
|
+
| [isPromptVideo](variables/isPromptVideo.mdx) | - |
|
|
357
|
+
| [isGrantedOnlyAudio](variables/isGrantedOnlyAudio.mdx) | - |
|
|
358
|
+
| [areBothGranted](variables/areBothGranted.mdx) | - |
|
|
359
|
+
| [isGrantedVideo](variables/isGrantedVideo.mdx) | - |
|
|
360
|
+
| [isGrantedAudio](variables/isGrantedAudio.mdx) | - |
|
|
361
|
+
| [isGranted](variables/isGranted.mdx) | - |
|
|
362
|
+
| [isOnlyAudioError](variables/isOnlyAudioError.mdx) | - |
|
|
363
|
+
| [isOnlyVideoError](variables/isOnlyVideoError.mdx) | - |
|
|
364
|
+
| [isRejected](variables/isRejected.mdx) | - |
|
|
365
|
+
| [isRejectedOnlyAudio](variables/isRejectedOnlyAudio.mdx) | - |
|
|
366
|
+
| [isRejectedOnlyVideo](variables/isRejectedOnlyVideo.mdx) | - |
|
|
367
|
+
| [isOverConstrained](variables/isOverConstrained.mdx) | - |
|
|
368
|
+
| [isUnknownError](variables/isUnknownError.mdx) | - |
|
|
369
|
+
| [isInitial](variables/isInitial.mdx) | - |
|
|
370
|
+
| [isInitialPermissions](variables/isInitialPermissions.mdx) | - |
|
|
371
|
+
| [isInitialPermissionsNotGranted](variables/isInitialPermissionsNotGranted.mdx) | - |
|
|
372
|
+
| [isRequestPermissionNeeded](variables/isRequestPermissionNeeded.mdx) | - |
|
|
373
|
+
| [isInitialPermissionsGranted](variables/isInitialPermissionsGranted.mdx) | - |
|
|
374
|
+
| [isAudioDeviceInUse](variables/isAudioDeviceInUse.mdx) | - |
|
|
375
|
+
| [isDeviceInUse](variables/isDeviceInUse.mdx) | - |
|
|
376
|
+
| [isDevicesInUse](variables/isDevicesInUse.mdx) | - |
|
|
377
|
+
| [isVideoDeviceInUse](variables/isVideoDeviceInUse.mdx) | - |
|
|
378
|
+
| [AUDIO\_CONTENT\_HINTS](variables/AUDIO_CONTENT_HINTS.mdx) | Audio content hints are only applicable when the MediaStreamTrack contains an audio track |
|
|
379
|
+
| [VIDEO\_CONTENT\_HINTS](variables/VIDEO_CONTENT_HINTS.mdx) | Video content hints are only applicable when the MediaStreamTrack contains a video track. |
|
|
380
|
+
|
|
381
|
+
## Functions
|
|
382
|
+
|
|
383
|
+
| Function | Description |
|
|
384
|
+
| ------ | ------ |
|
|
385
|
+
| [createAudioMixingProcess](functions/createAudioMixingProcess.mdx) | Create an Audio Mixing Processor and will own the stream passed-in |
|
|
386
|
+
| [createAudioStreamProcess](functions/createAudioStreamProcess.mdx) | Create an Audio Stream Processor and will own the stream passed-in |
|
|
387
|
+
| [createGetDisplayMedia](functions/createGetDisplayMedia.mdx) | - |
|
|
388
|
+
| [setLogger](functions/setLogger.mdx) | - |
|
|
389
|
+
| [createMedia](functions/createMedia.mdx) | Create an object to interact with the media scream, which is usually used for our main stream. |
|
|
390
|
+
| [createPreviewStreamController](functions/createPreviewStreamController.mdx) | - |
|
|
391
|
+
| [createMediaSignal](functions/createMediaSignal.mdx) | Create a general signal with consistent scoped name |
|
|
392
|
+
| [createMediaSignals](functions/createMediaSignals.mdx) | Create and return all required and optional (if specified with `more`), signals for media to work |
|
|
393
|
+
| [toDeniedDevices](functions/toDeniedDevices.mdx) | - |
|
|
394
|
+
| [getPermissionStatus](functions/getPermissionStatus.mdx) | - |
|
|
395
|
+
| [deriveInitialPermissionStatus](functions/deriveInitialPermissionStatus.mdx) | - |
|
|
396
|
+
| [isNonNullObject](functions/isNonNullObject.mdx) | - |
|
|
397
|
+
| [isUserMediaStatus](functions/isUserMediaStatus.mdx) | - |
|
|
398
|
+
| [isMedia](functions/isMedia.mdx) | - |
|
|
399
|
+
| [isAnalyzerNodeInitProp](functions/isAnalyzerNodeInitProp.mdx) | - |
|
|
400
|
+
| [isAudioContentHint](functions/isAudioContentHint.mdx) | - |
|
|
401
|
+
| [isVideoContentHint](functions/isVideoContentHint.mdx) | - |
|
|
402
|
+
| [isVideoStreamTrackProcessorAPIs](functions/isVideoStreamTrackProcessorAPIs.mdx) | - |
|
|
403
|
+
| [getBlurKernelSize](functions/getBlurKernelSize.mdx) | A function to get the blur kernel size of image height based on Kawase blur algorithm |
|
|
404
|
+
| [getTentBlurSize](functions/getTentBlurSize.mdx) | A function to get the Tent blur size of image height |
|
|
405
|
+
| [applyContentHint](functions/applyContentHint.mdx) | Apply the content hint to the track |
|
|
406
|
+
| [createVideoStreamProcess](functions/createVideoStreamProcess.mdx) | - |
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
## Enumeration Members
|
|
2
|
+
|
|
3
|
+
| Enumeration Member | Value | Description |
|
|
4
|
+
| ------ | ------ | ------ |
|
|
5
|
+
| <a id="initial"></a> `Initial` | `"initial"` | The initial status |
|
|
6
|
+
| <a id="initialpermissionsgranted"></a> `InitialPermissionsGranted` | `"initial-permissions-granted"` | When we know the permissions were already granted from permission API |
|
|
7
|
+
| <a id="initialpermissionsnotgranted"></a> `InitialPermissionsNotGranted` | `"initial-permissions-not-granted"` | When we do not know the permissions from permission API |
|
|
8
|
+
| <a id="initialpermissionsvideoinputdenied"></a> `InitialPermissionsVideoInputDenied` | `"initial-permissions-videoinput-denied"` | When video input permissions are initially denied in the browser and audio input permissions are unknown |
|
|
9
|
+
| <a id="initialpermissionsaudioinputdenied"></a> `InitialPermissionsAudioInputDenied` | `"initial-permissions-audioinput-denied"` | When audio input permissions are initially denied in the browser and video input permissions are unknown |
|
|
10
|
+
| <a id="initialpermissionsvideoinputgranted"></a> `InitialPermissionsVideoInputGranted` | `"initial-permissions-videoinput-granted"` | When video input permissions are granted in the browser and audio input permissions are unknown |
|
|
11
|
+
| <a id="initialpermissionsaudioinputgranted"></a> `InitialPermissionsAudioInputGranted` | `"initial-permissions-audioinput-granted"` | When audio input permissions are granted in the browser and video input permissions are unknown |
|
|
12
|
+
| <a id="initialpermissionsgrantedvideoinputdenied"></a> `InitialPermissionsGrantedVideoInputDenied` | `"initial-permissions-audioinput-granted-videoinput-denied"` | When audio input permissions are granted but video input permissions are initially denied |
|
|
13
|
+
| <a id="initialpermissionsgrantedaudioinputdenied"></a> `InitialPermissionsGrantedAudioInputDenied` | `"initial-permissions-videoinput-granted-audioinput-denied"` | When video input permissions are granted but audio input permissions are initially denied |
|
|
14
|
+
| <a id="nodevicesfound"></a> `NoDevicesFound` | `"no-devices-found"` | When there is no any kind of input devices |
|
|
15
|
+
| <a id="novideodevicesfound"></a> `NoVideoDevicesFound` | `"no-video-devices-found"` | When there is no any video input devices |
|
|
16
|
+
| <a id="noaudiodevicesfound"></a> `NoAudioDevicesFound` | `"no-audio-devices-found"` | When there is no any audio input devices |
|
|
17
|
+
| <a id="audiodevicenotfound"></a> `AudioDeviceNotFound` | `"audio-device-not-found"` | Derived from `MediaDeviceFailure.AudioInputDeviceNotFoundError` |
|
|
18
|
+
| <a id="videodevicenotfound"></a> `VideoDeviceNotFound` | `"video-device-not-found"` | Derived from `MediaDeviceFailure.VideoInputDeviceNotFoundError` |
|
|
19
|
+
| <a id="audiovideodevicesnotfound"></a> `AudioVideoDevicesNotFound` | `"audio-video-devices-not-found"` | Derived from `MediaDeviceFailure.AudioAndVideoDeviceNotFoundError` |
|
|
20
|
+
| <a id="permissionsgranted"></a> `PermissionsGranted` | `"permissions-granted"` | When Permission is granted by user for both video and audio, and both devices are exactly matched with the request constraints |
|
|
21
|
+
| <a id="permissionsgrantedfallback"></a> `PermissionsGrantedFallback` | `"permissions-granted-fallback-devices"` | When Permission is granted by user for both video and audio, and both devices are NOT exactly matched with the request constraints |
|
|
22
|
+
| <a id="permissionsgrantedfallbackaudioinput"></a> `PermissionsGrantedFallbackAudioinput` | `"permissions-granted-fallback-audioinput"` | When Permission is granted by user for both video and audio, and audio input is NOT exactly matched with the request constraints |
|
|
23
|
+
| <a id="permissionsgrantedfallbackvideoinput"></a> `PermissionsGrantedFallbackVideoinput` | `"permissions-granted-fallback-videoinput"` | When Permission is granted by user for both video and audio, and video input is NOT exactly matched with the request constraints |
|
|
24
|
+
| <a id="permissionsrejected"></a> `PermissionsRejected` | `"permissions-rejected"` | When Permission for using both audio and video devices are rejected by the user from `PermissionDeniedError` |
|
|
25
|
+
| <a id="permissionsrejectedaudioinput"></a> `PermissionsRejectedAudioInput` | `"permissions-rejected-audioinput"` | When Permission for using the audio device is rejected by the user from `PermissionDeniedError` |
|
|
26
|
+
| <a id="permissionsrejectedvideoinput"></a> `PermissionsRejectedVideoInput` | `"permissions-rejected-videoinput"` | When Permission for using the video device is rejected by the user from `PermissionDeniedError` |
|
|
27
|
+
| <a id="permissionsonlyaudioinput"></a> `PermissionsOnlyAudioinput` | `"permissions-only-audioinput"` | When only request and return exact audio input device |
|
|
28
|
+
| <a id="permissionsonlyaudioinputnovideodevices"></a> `PermissionsOnlyAudioinputNoVideoDevices` | `"permissions-only-audioinput-no-video-devices"` | When only request audio input device because of no video devices available and returned exact audio input device |
|
|
29
|
+
| <a id="permissionsonlyaudioinputfallback"></a> `PermissionsOnlyAudioinputFallback` | `"permissions-only-fallback-audioinput"` | When only request and returned NOT exact audio input device |
|
|
30
|
+
| <a id="permissionsonlyaudioinputfallbacknovideodevices"></a> `PermissionsOnlyAudioinputFallbackNoVideoDevices` | `"permissions-only-fallback-audioinput-no-video-devices"` | When only request audio input device because of no video devices available and returned NOT exact audio input device |
|
|
31
|
+
| <a id="permissionsonlyvideoinput"></a> `PermissionsOnlyVideoinput` | `"permissions-only-videoinput"` | When only request and return exact video input device |
|
|
32
|
+
| <a id="permissionsonlyvideoinputnoaudiodevices"></a> `PermissionsOnlyVideoinputNoAudioDevices` | `"permissions-only-videoinput-no-audio-devices"` | When only request video input device because of no audio devices available and returned exact video input device |
|
|
33
|
+
| <a id="permissionsonlyvideoinputfallback"></a> `PermissionsOnlyVideoinputFallback` | `"permissions-only-fallback-videoinput"` | When only request and returned NOT exact video input device |
|
|
34
|
+
| <a id="permissionsonlyvideoinputfallbacknoaudiodevices"></a> `PermissionsOnlyVideoinputFallbackNoAudioDevices` | `"permissions-only-fallback-videoinput-no-audio-devices"` | When only request video input device because of no video devices available and returned NOT exact video input device |
|
|
35
|
+
| <a id="audiodeviceinuse"></a> `AudioDeviceInUse` | `"audio-device-in-use"` | When requesting the audio device is used by other application |
|
|
36
|
+
| <a id="videodeviceinuse"></a> `VideoDeviceInUse` | `"video-device-in-use"` | When requesting the video device is used by other application |
|
|
37
|
+
| <a id="devicesinuse"></a> `DevicesInUse` | `"devices-in-use"` | When requesting both audio and video devices are used by other application |
|
|
38
|
+
| <a id="overconstrained"></a> `Overconstrained` | `"overconstrained"` | When requesting both audio and video with over-constrained |
|
|
39
|
+
| <a id="videooverconstrained"></a> `VideoOverconstrained` | `"video-overconstrained"` | When requesting video with over-constrained |
|
|
40
|
+
| <a id="audiooverconstrained"></a> `AudioOverconstrained` | `"audio-overconstrained"` | When requesting audio with over-constrained |
|
|
41
|
+
| <a id="invalidconstraints"></a> `InvalidConstraints` | `"invalid-constraints"` | When requesting both audio and video with invalid constraints |
|
|
42
|
+
| <a id="invalidvideoconstraints"></a> `InvalidVideoConstraints` | `"invalid-video-constraints"` | When requesting video with invalid constraints |
|
|
43
|
+
| <a id="invalidaudioconstraints"></a> `InvalidAudioConstraints` | `"invalid-audio-constraints"` | When requesting audio with invalid constraints |
|
|
44
|
+
| <a id="notsupportederror"></a> `NotSupportedError` | `"not-supported-error"` | When requesting both audio and video with NotSupportedError |
|
|
45
|
+
| <a id="notsupportederroronlyvideoinput"></a> `NotSupportedErrorOnlyVideoInput` | `"not-supported-error-only-video"` | When requesting video with NotSupportedError |
|
|
46
|
+
| <a id="notsupportederroronlyaudioinput"></a> `NotSupportedErrorOnlyAudioInput` | `"not-supported-error-only-audio"` | When requesting audio with NotSupportedError |
|
|
47
|
+
| <a id="unknownerror"></a> `UnknownError` | `"unknown-error"` | Unknown error from both video and audio |
|
|
48
|
+
| <a id="unknownerroronlyaudioinput"></a> `UnknownErrorOnlyAudioinput` | `"unknown-error-only-audioinput"` | Unknown error from audio device |
|
|
49
|
+
| <a id="unknownerroronlyvideoinput"></a> `UnknownErrorOnlyVideoinput` | `"unknown-error-only-videoinput"` | Unknown error from video device |
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function applyContentHint<T>(hint?): (track) => void;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Apply the content hint to the track
|
|
6
|
+
|
|
7
|
+
## Type Parameters
|
|
8
|
+
|
|
9
|
+
| Type Parameter |
|
|
10
|
+
| ------ |
|
|
11
|
+
| `T` *extends* \| `""` \| `"speech"` \| `"speech-recognition"` \| `"music"` \| `"motion"` \| `"detail"` \| `"text"` |
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
| Parameter | Type | Description |
|
|
16
|
+
| ------ | ------ | ------ |
|
|
17
|
+
| `hint?` | `T` | Content hint |
|
|
18
|
+
|
|
19
|
+
## Returns
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
(track): void;
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Parameters
|
|
26
|
+
|
|
27
|
+
| Parameter | Type |
|
|
28
|
+
| ------ | ------ |
|
|
29
|
+
| `track` | `MediaStreamTrack` |
|
|
30
|
+
|
|
31
|
+
### Returns
|
|
32
|
+
|
|
33
|
+
`void`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createAudioMixingProcess(
|
|
3
|
+
getCurrentMedia,
|
|
4
|
+
signals?,
|
|
5
|
+
label?): TrackProcessor;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Create an Audio Mixing Processor and will own the stream passed-in
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| Parameter | Type | Default value |
|
|
13
|
+
| ------ | ------ | ------ |
|
|
14
|
+
| `getCurrentMedia` | () => `MediaStream` \| `undefined` | `undefined` |
|
|
15
|
+
| `signals?` | [`MediaSignals`](../type-aliases/MediaSignals.mdx) | `undefined` |
|
|
16
|
+
| `label?` | `"AudioMixingProcessor"` | `PROCESSOR_LABELS.AudioMixingProcessor` |
|
|
17
|
+
|
|
18
|
+
## Returns
|
|
19
|
+
|
|
20
|
+
[`TrackProcessor`](../type-aliases/TrackProcessor.mdx)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createAudioStreamProcess(__namedParameters): TrackProcessor;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create an Audio Stream Processor and will own the stream passed-in
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type |
|
|
10
|
+
| ------ | ------ |
|
|
11
|
+
| `__namedParameters` | `AudioProcessOptions` & `ThrottleOptions` |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
[`TrackProcessor`](../type-aliases/TrackProcessor.mdx)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createGetDisplayMedia(getDefaultConstraints, getDisplayMedia): (constraints?) => Promise<MediaStream | undefined>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Parameter | Type |
|
|
8
|
+
| ------ | ------ |
|
|
9
|
+
| `getDefaultConstraints` | () => `DisplayMediaOptions` |
|
|
10
|
+
| `getDisplayMedia` | (`options?`) => `Promise`\<`MediaStream`\> |
|
|
11
|
+
|
|
12
|
+
## Returns
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
(constraints?): Promise<MediaStream | undefined>;
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Parameters
|
|
19
|
+
|
|
20
|
+
| Parameter | Type |
|
|
21
|
+
| ------ | ------ |
|
|
22
|
+
| `constraints?` | `DisplayMediaOptions` |
|
|
23
|
+
|
|
24
|
+
### Returns
|
|
25
|
+
|
|
26
|
+
`Promise`\<`MediaStream` \| `undefined`\>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createMedia(options): MediaController;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create an object to interact with the media scream, which is usually used for
|
|
6
|
+
our main stream.
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
| Parameter | Type | Description |
|
|
11
|
+
| ------ | ------ | ------ |
|
|
12
|
+
| `options` | [`MediaOptions`](../interfaces/MediaOptions.mdx) | |
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
[`MediaController`](../interfaces/MediaController.mdx)
|
|
17
|
+
|
|
18
|
+
## See
|
|
19
|
+
|
|
20
|
+
MediaOptions
|