@pexip/media-control 20.3.3 → 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 +15 -0
- package/api-docs/README.mdx +374 -0
- package/api-docs/enumerations/MediaDeviceFailure.mdx +23 -0
- package/api-docs/enumerations/MediaDeviceKinds.mdx +11 -0
- package/api-docs/enumerations/MediaEventType.mdx +22 -0
- package/api-docs/functions/applyConstraints.mdx +16 -0
- package/api-docs/functions/areMultipleFacingModeSupported.mdx +21 -0
- package/api-docs/functions/areTracksEnabled.mdx +16 -0
- package/api-docs/functions/compareDevices.mdx +28 -0
- package/api-docs/functions/createIndexedDevices.mdx +16 -0
- package/api-docs/functions/createStreamTrackEventSubscriptions.mdx +20 -0
- package/api-docs/functions/createTrackDevicesChanges.mdx +31 -0
- package/api-docs/functions/deviceChanged.mdx +21 -0
- package/api-docs/functions/extractConstrainDevice.mdx +14 -0
- package/api-docs/functions/extractConstraintsWithKeys.mdx +51 -0
- package/api-docs/functions/findCurrentAudioOutputId.mdx +16 -0
- package/api-docs/functions/findCurrentVideoInputDeviceIdFromStream.mdx +15 -0
- package/api-docs/functions/findDevice.mdx +33 -0
- package/api-docs/functions/findDeviceFromConstraints.mdx +24 -0
- package/api-docs/functions/findDeviceWithDeviceId.mdx +19 -0
- package/api-docs/functions/findDevicesByKind.mdx +27 -0
- package/api-docs/functions/findMediaInputFromMediaStreamTrack.mdx +32 -0
- package/api-docs/functions/findMediaInputFromStream.mdx +27 -0
- package/api-docs/functions/findPermissionGrantedDevices.mdx +15 -0
- package/api-docs/functions/getDeviceId.mdx +17 -0
- package/api-docs/functions/getDevices.mdx +9 -0
- package/api-docs/functions/getFacingModeFromConstraintString.mdx +13 -0
- package/api-docs/functions/getInputDevicePermissionState.mdx +21 -0
- package/api-docs/functions/getValueFromConstrainNumber.mdx +13 -0
- package/api-docs/functions/hasAnyGrantedInput.mdx +15 -0
- package/api-docs/functions/hasAnyInputs.mdx +23 -0
- package/api-docs/functions/hasAudioInputs.mdx +15 -0
- package/api-docs/functions/hasAudioOrVideoInputs.mdx +15 -0
- package/api-docs/functions/hasChangedInput.mdx +16 -0
- package/api-docs/functions/hasRequestingDevice.mdx +20 -0
- package/api-docs/functions/hasVideoInputs.mdx +15 -0
- package/api-docs/functions/interpretCurrentFacingMode.mdx +17 -0
- package/api-docs/functions/isDeviceGranted.mdx +20 -0
- package/api-docs/functions/isExactDeviceConstraint.mdx +15 -0
- package/api-docs/functions/isFacingMode.mdx +13 -0
- package/api-docs/functions/isIndexedDevices.mdx +13 -0
- package/api-docs/functions/isInputConstraintSet.mdx +13 -0
- package/api-docs/functions/isMediaDeviceInfo.mdx +15 -0
- package/api-docs/functions/isMediaDeviceInfoArray.mdx +13 -0
- package/api-docs/functions/isMediaStreamTrack.mdx +15 -0
- package/api-docs/functions/isRequestedInputDevice.mdx +14 -0
- package/api-docs/functions/isRequestedInputTrack.mdx +16 -0
- package/api-docs/functions/isRequestedResolution.mdx +14 -0
- package/api-docs/functions/isStreamingRequestedDevices.mdx +28 -0
- package/api-docs/functions/isStreamingRequestedDevicesBase.mdx +25 -0
- package/api-docs/functions/isStreamingRequestingDevice.mdx +18 -0
- package/api-docs/functions/isTrackMutedOrEnded.mdx +15 -0
- package/api-docs/functions/limitSharingMonitorInterface.mdx +18 -0
- package/api-docs/functions/mergeConstraints.mdx +35 -0
- package/api-docs/functions/muteStreamTrack.mdx +28 -0
- package/api-docs/functions/relaxInputConstraint.mdx +26 -0
- package/api-docs/functions/resolveMediaDeviceConstraints.mdx +19 -0
- package/api-docs/functions/reverseDeviceId.mdx +22 -0
- package/api-docs/functions/setLogger.mdx +13 -0
- package/api-docs/functions/shouldRequestDevice.mdx +21 -0
- package/api-docs/functions/stopMediaStream.mdx +20 -0
- package/api-docs/functions/toKey.mdx +15 -0
- package/api-docs/functions/toMediaDeviceInfo.mdx +20 -0
- package/api-docs/functions/toMediaDeviceInfoLike.mdx +18 -0
- package/api-docs/functions/toMediaDeviceInputKind.mdx +13 -0
- package/api-docs/interfaces/DisplayMediaOptions.mdx +22 -0
- package/api-docs/interfaces/IndexedDevices.mdx +102 -0
- package/api-docs/interfaces/InputConstraintSet.mdx +43 -0
- package/api-docs/interfaces/InputDevicePermission.mdx +6 -0
- package/api-docs/interfaces/MediaControl.mdx +14 -0
- package/api-docs/interfaces/MediaDeviceRequest.mdx +10 -0
- package/api-docs/interfaces/MediaInput.mdx +10 -0
- package/api-docs/interfaces/StreamTrackEventHandlers.mdx +9 -0
- package/api-docs/type-aliases/CursorCaptureConstraint.mdx +10 -0
- package/api-docs/type-aliases/DeviceChangedChanges.mdx +19 -0
- package/api-docs/type-aliases/DisplayCaptureSurfaceType.mdx +10 -0
- package/api-docs/type-aliases/Events.mdx +51 -0
- package/api-docs/type-aliases/FacingMode.mdx +3 -0
- package/api-docs/type-aliases/IncludeExcludeConstraint.mdx +3 -0
- package/api-docs/type-aliases/InputDeviceConstraint.mdx +6 -0
- package/api-docs/type-aliases/MediaDeviceInfoLike.mdx +13 -0
- package/api-docs/type-aliases/MediaEvent.mdx +7 -0
- package/api-docs/type-aliases/MediaStreamTrackLike.mdx +7 -0
- package/api-docs/type-aliases/Unsubscribe.mdx +7 -0
- package/api-docs/variables/CURSOR_CAPTURE_CONSTRAINT.mdx +18 -0
- package/api-docs/variables/DEVICE_ID_SEPARATOR.mdx +3 -0
- package/api-docs/variables/DISPLAY_CAPTURE_SURFACE_TYPE.mdx +18 -0
- package/api-docs/variables/INCLUDE_EXCLUDE_CONSTRAINT.mdx +10 -0
- package/api-docs/variables/findAudioInputDevices.mdx +19 -0
- package/api-docs/variables/findAudioOutputDevices.mdx +19 -0
- package/api-docs/variables/findVideoInputDevices.mdx +19 -0
- package/api-docs/variables/getUserMedia.mdx +21 -0
- package/api-docs/variables/isAudioInput.mdx +13 -0
- package/api-docs/variables/isAudioOutput.mdx +13 -0
- package/api-docs/variables/isVideoInput.mdx +13 -0
- package/api-docs/variables/setDefaultConstraints.mdx +17 -0
- package/api-docs/variables/subscribe.mdx +25 -0
- package/package.json +15 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 20.3.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 13e3722: Generate the package documentation in a folder called doc-dist
|
|
8
|
+
- Updated dependencies [13e3722]
|
|
9
|
+
- @pexip/utils@17.1.3
|
|
10
|
+
|
|
11
|
+
## 20.3.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [0e1a7b7]
|
|
16
|
+
- @pexip/utils@17.1.2
|
|
17
|
+
|
|
3
18
|
## 20.3.3
|
|
4
19
|
|
|
5
20
|
## 20.3.2
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
# `@pexip/media-control`
|
|
2
|
+
|
|
3
|
+
Abstract away all the quirks of handling media devices
|
|
4
|
+
|
|
5
|
+
A library that will handle media by wrapping
|
|
6
|
+
[`enumerateDevices`][enumeratedevices] and [`getUserMedia`][getusermedia]
|
|
7
|
+
extending both functions with additional logic.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
`npm install @pexip/media-control`
|
|
12
|
+
|
|
13
|
+
## Table of Contents
|
|
14
|
+
|
|
15
|
+
- [Introduction](#introduction)
|
|
16
|
+
- [Installation](#installation)
|
|
17
|
+
- [Usage](#usage)
|
|
18
|
+
|
|
19
|
+
## Introduction
|
|
20
|
+
|
|
21
|
+
This library is meant to extend the [`mediaDevices`][mediadevices] api methods
|
|
22
|
+
such as [`getUserMedia`][getusermedia], [`enumerateDevices`][enumeratedevices]
|
|
23
|
+
and events on media streams and tracks.
|
|
24
|
+
|
|
25
|
+
The final goal is to have a library that gives a stable and robust way to use
|
|
26
|
+
these methods while guaranteeing that the developer has better control over
|
|
27
|
+
which devices are delivered, fail, or exist.
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
The package is published to Github registry scoped with @pexip. _Access right to
|
|
32
|
+
@pexip is needed in order to install the package._
|
|
33
|
+
|
|
34
|
+
Here is the steps to setup Github Personal Access Token for `npm`/`yarn` in
|
|
35
|
+
order to add the package.
|
|
36
|
+
|
|
37
|
+
1. A Github Personal Access Token is needed to be setup in order to get the
|
|
38
|
+
@pexip/media-control package. Follow [Github's doc][github package pat] to
|
|
39
|
+
create a Personal Access Token.
|
|
40
|
+
|
|
41
|
+
2. When the Personal Access Token is ready, you can set it up for `npm` or
|
|
42
|
+
`yarn` via `.npmrc`. By adding your personal access token to your `~/.npmrc`
|
|
43
|
+
file, edit the `~/.npmrc` file for your project to include the following
|
|
44
|
+
line, replacing TOKEN with your personal access token. Create a new
|
|
45
|
+
`~/.npmrc` file if one doesn't exist.
|
|
46
|
+
|
|
47
|
+
```config
|
|
48
|
+
//npm.pkg.github.com/:_authToken=TOKEN
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
3. Add a local `.npmrc` file to your repository with the following lines to tell
|
|
52
|
+
the package manager, `npm` or `yarn` where the registry is for `@pexip`
|
|
53
|
+
scoped packages.
|
|
54
|
+
|
|
55
|
+
```config
|
|
56
|
+
@pexip:registry=https://npm.pkg.github.com
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
4. Now it is ready to add any `@pexip/PACKAGE_NAME` package to your repository.
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
# Use yarn
|
|
63
|
+
yarn add @pexip/media-control
|
|
64
|
+
|
|
65
|
+
# Or use npm
|
|
66
|
+
npm install @pexip/media-control
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**P.S.:** _there is no polyfill added to this package, the user needs to add
|
|
70
|
+
polyfill to the application, i.e. `core-js`. We leverage on
|
|
71
|
+
`@babel/plugin-transform-runtime` and `@babel/runtime` to accomplish this._
|
|
72
|
+
|
|
73
|
+
## Usage
|
|
74
|
+
|
|
75
|
+
### Get user media
|
|
76
|
+
|
|
77
|
+
Get stream with audio and video without specifying devices, let the browser
|
|
78
|
+
choose the right devices.
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
import {getUserMedia} from '@pexip/media-control';
|
|
82
|
+
|
|
83
|
+
const stream = await getUserMedia({audio: true, video: true});
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Only get stream with video
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
import {getUserMedia} from '@pexip/media-control';
|
|
90
|
+
|
|
91
|
+
// neglecting audioInput is the same as setting it explicitly to false
|
|
92
|
+
const stream = await getUserMedia({video: true});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Get stream with the specific device only but any for audio.
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import {getUserMedia} from 'media-control';
|
|
99
|
+
|
|
100
|
+
const videoInputWanted = {
|
|
101
|
+
deviceId: '0abbc454-71e5-4f7e-9c8b-9de36f1334c3',
|
|
102
|
+
kind: 'videoinput',
|
|
103
|
+
label: 'Camera',
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const stream = await getUserMedia({
|
|
107
|
+
audio: true,
|
|
108
|
+
video: {device: {exact: videoInputWanted}},
|
|
109
|
+
});
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Get stream with specific video input and fallback if it's not available and the
|
|
113
|
+
specific audio input only, no fallback
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
import {getUserMedia} from 'media-control';
|
|
117
|
+
|
|
118
|
+
const audioInput = {
|
|
119
|
+
deviceId: 'a373b235-3ebf-40c7-b619-a491e05e35e6',
|
|
120
|
+
label: "Rick's Microphone",
|
|
121
|
+
kind: 'audioinput',
|
|
122
|
+
};
|
|
123
|
+
const videoInput = {
|
|
124
|
+
deviceId: '0abbc454-71e5-4f7e-9c8b-9de36f1334c3',
|
|
125
|
+
label: "Morty's Camera",
|
|
126
|
+
kind: 'videoinput',
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const stream = await getUserMedia({
|
|
130
|
+
audio: {device: {exact: audioInput}},
|
|
131
|
+
video: videoInput,
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Get stream with specific devices and fallback when they are not available
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
import {getUserMedia} from 'media-control';
|
|
139
|
+
|
|
140
|
+
const audioInput = {
|
|
141
|
+
deviceId: 'a373b235-3ebf-40c7-b619-a491e05e35e6',
|
|
142
|
+
label: "Rick's Microphone",
|
|
143
|
+
kind: 'audioinput',
|
|
144
|
+
};
|
|
145
|
+
const videoInput = {
|
|
146
|
+
deviceId: '0abbc454-71e5-4f7e-9c8b-9de36f1334c3',
|
|
147
|
+
label: "Morty's Camera",
|
|
148
|
+
kind: 'videoinput',
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const stream = await getUserMedia({
|
|
152
|
+
audio: audioInput,
|
|
153
|
+
video: videoInput,
|
|
154
|
+
});
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
The following requests both audio and video without any specific requirements:
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
import {getUserMedia} from 'media-control';
|
|
161
|
+
|
|
162
|
+
const stream = await getUserMedia({audio: true, video: true});
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The following expresses a preference for 1280x720 camera resolution:
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
import {getUserMedia} from 'media-control';
|
|
169
|
+
|
|
170
|
+
const stream = await getUserMedia({
|
|
171
|
+
audio: true,
|
|
172
|
+
video: {
|
|
173
|
+
width: 1280,
|
|
174
|
+
height: 720,
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The following expresses a preference for user facing camera:
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
import {getUserMedia} from 'media-control';
|
|
183
|
+
|
|
184
|
+
const stream = await getUserMedia({
|
|
185
|
+
audio: true,
|
|
186
|
+
video: {facingMode: 'user'},
|
|
187
|
+
});
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Subscribe media events
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
import {MediaEventType, subscribe} from 'media-control';
|
|
194
|
+
|
|
195
|
+
subscribe((event: MediaEvent) => {
|
|
196
|
+
switch (event.detail.type) {
|
|
197
|
+
case MediaEventType.Mute: // {id: string}
|
|
198
|
+
// id of the device that was muted
|
|
199
|
+
const id = event.detail.id;
|
|
200
|
+
break;
|
|
201
|
+
case MediaEventType.Unmute: // {id: string}
|
|
202
|
+
// id of the device that was unmuted
|
|
203
|
+
const id = event.detail.id;
|
|
204
|
+
break;
|
|
205
|
+
case MediaEventType.Ended: // {id: string}
|
|
206
|
+
// id of the device that ended
|
|
207
|
+
const id = event.detail.id;
|
|
208
|
+
break;
|
|
209
|
+
case MediaEventType.DevicesChanged: // {devices: MediaDeviceInfo[]}
|
|
210
|
+
// devices currently available through enumerateDevices
|
|
211
|
+
const devices = event.detail.devices;
|
|
212
|
+
break;
|
|
213
|
+
case MediaEventType.DevicesFound: // {devices: MediaDeviceInfo[], authorizedDevices: MediaDeviceInfo[]}
|
|
214
|
+
// new devices connected
|
|
215
|
+
const devices = event.detail.devices;
|
|
216
|
+
break;
|
|
217
|
+
case MediaEventType.DevicesLost: // {devices: MediaDeviceInfo[], authorizedDevices: MediaDeviceInfo[]}
|
|
218
|
+
// devices lost from the enumerateDevices list
|
|
219
|
+
const devices = event.detail.devices;
|
|
220
|
+
break;
|
|
221
|
+
case MediaEventType.DeviceLost: // {device: MediaDeviceInfo}
|
|
222
|
+
// device currently in use that was lost from the enumerateDevices list
|
|
223
|
+
const device = event.detail.device;
|
|
224
|
+
break;
|
|
225
|
+
case MediaEventType.DevicesUnauthorized: // {devices: MediaDeviceInfo[], authorizedDevices: MediaDeviceInfo[]}
|
|
226
|
+
// Unauthorized list of devices
|
|
227
|
+
const device = event.detail.devices;
|
|
228
|
+
break;
|
|
229
|
+
case MediaEventType.NoInputDevices:
|
|
230
|
+
// Indicate that there is no input devices from the machine
|
|
231
|
+
break;
|
|
232
|
+
case MediaEventType.Error: // {error: Error}
|
|
233
|
+
const error = event.detail.error;
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
[mediadevices]: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices
|
|
240
|
+
[enumeratedevices]:
|
|
241
|
+
https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/enumerateDevices
|
|
242
|
+
[getusermedia]:
|
|
243
|
+
https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
|
|
244
|
+
[mediadeviceinfo]:
|
|
245
|
+
https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo
|
|
246
|
+
[github package pat]:
|
|
247
|
+
https://help.github.com/en/github/managing-packages-with-github-packages/about-github-packages#about-tokens
|
|
248
|
+
[parcel]: https://parceljs.org
|
|
249
|
+
|
|
250
|
+
media-control is meant to extend the mediaDevices api methods such as
|
|
251
|
+
`getUserMedia`, `enumerateDevices` and events on media streams and tracks.
|
|
252
|
+
The final goal is to have a library that gives a stable and robust way to use
|
|
253
|
+
these methods while guaranteeing that the developer has better control over
|
|
254
|
+
which devices are delivered, fail, or exist.
|
|
255
|
+
|
|
256
|
+
## Enumerations
|
|
257
|
+
|
|
258
|
+
| Enumeration | Description |
|
|
259
|
+
| ------ | ------ |
|
|
260
|
+
| [MediaEventType](enumerations/MediaEventType.mdx) | MediaStreamTrack Events |
|
|
261
|
+
| [MediaDeviceKinds](enumerations/MediaDeviceKinds.mdx) | an enum of MediaDeviceKind which can be reused |
|
|
262
|
+
| [MediaDeviceFailure](enumerations/MediaDeviceFailure.mdx) | An enum of failure events for media device |
|
|
263
|
+
|
|
264
|
+
## Interfaces
|
|
265
|
+
|
|
266
|
+
| Interface | Description |
|
|
267
|
+
| ------ | ------ |
|
|
268
|
+
| [MediaControl](interfaces/MediaControl.mdx) | MediaControl Interface |
|
|
269
|
+
| [IndexedDevices](interfaces/IndexedDevices.mdx) | - |
|
|
270
|
+
| [InputConstraintSet](interfaces/InputConstraintSet.mdx) | - |
|
|
271
|
+
| [MediaDeviceRequest](interfaces/MediaDeviceRequest.mdx) | The request constraints that applies to `getMediaStream` |
|
|
272
|
+
| [MediaInput](interfaces/MediaInput.mdx) | Holds user media input devices |
|
|
273
|
+
| [StreamTrackEventHandlers](interfaces/StreamTrackEventHandlers.mdx) | An object contains the event handlers |
|
|
274
|
+
| [InputDevicePermission](interfaces/InputDevicePermission.mdx) | - |
|
|
275
|
+
| [DisplayMediaOptions](interfaces/DisplayMediaOptions.mdx) | The `DisplayMediaStreamOptions` dictionary is used to instruct the user agent what sort of `MediaStreamTracks` may be included in the `MediaStream` returned by `getDisplayMedia`. |
|
|
276
|
+
|
|
277
|
+
## Type Aliases
|
|
278
|
+
|
|
279
|
+
| Type Alias | Description |
|
|
280
|
+
| ------ | ------ |
|
|
281
|
+
| [DisplayCaptureSurfaceType](type-aliases/DisplayCaptureSurfaceType.mdx) | The `DisplayCaptureSurfaceType` enumeration describes the different types of display surface |
|
|
282
|
+
| [CursorCaptureConstraint](type-aliases/CursorCaptureConstraint.mdx) | The `CursorCaptureConstraint` enumerates the conditions under which the cursor is captured. |
|
|
283
|
+
| [IncludeExcludeConstraint](type-aliases/IncludeExcludeConstraint.mdx) | - |
|
|
284
|
+
| [DeviceChangedChanges](type-aliases/DeviceChangedChanges.mdx) | DeviceChange Event |
|
|
285
|
+
| [Events](type-aliases/Events.mdx) | Event object by MediaEventType |
|
|
286
|
+
| [MediaEvent](type-aliases/MediaEvent.mdx) | Custom Media Event |
|
|
287
|
+
| [MediaDeviceInfoLike](type-aliases/MediaDeviceInfoLike.mdx) | A striped version of MediaDeviceInfo |
|
|
288
|
+
| [InputDeviceConstraint](type-aliases/InputDeviceConstraint.mdx) | - |
|
|
289
|
+
| [FacingMode](type-aliases/FacingMode.mdx) | - |
|
|
290
|
+
| [MediaStreamTrackLike](type-aliases/MediaStreamTrackLike.mdx) | Lesser strict type of `MediaStreamTrack` |
|
|
291
|
+
| [Unsubscribe](type-aliases/Unsubscribe.mdx) | - |
|
|
292
|
+
|
|
293
|
+
## Variables
|
|
294
|
+
|
|
295
|
+
| Variable | Description |
|
|
296
|
+
| ------ | ------ |
|
|
297
|
+
| [DISPLAY\_CAPTURE\_SURFACE\_TYPE](variables/DISPLAY_CAPTURE_SURFACE_TYPE.mdx) | The `DisplayCaptureSurfaceType` enumeration describes the different types of display surface |
|
|
298
|
+
| [CURSOR\_CAPTURE\_CONSTRAINT](variables/CURSOR_CAPTURE_CONSTRAINT.mdx) | The `CursorCaptureConstraint` enumerates the conditions under which the cursor is captured. |
|
|
299
|
+
| [INCLUDE\_EXCLUDE\_CONSTRAINT](variables/INCLUDE_EXCLUDE_CONSTRAINT.mdx) | - |
|
|
300
|
+
| [DEVICE\_ID\_SEPARATOR](variables/DEVICE_ID_SEPARATOR.mdx) | - |
|
|
301
|
+
| [findAudioInputDevices](variables/findAudioInputDevices.mdx) | Find in the list of devices only the audio input ones |
|
|
302
|
+
| [findVideoInputDevices](variables/findVideoInputDevices.mdx) | Find in the list of devices only the video input ones |
|
|
303
|
+
| [findAudioOutputDevices](variables/findAudioOutputDevices.mdx) | Find in the list of devices only the audio output ones |
|
|
304
|
+
| [getUserMedia](variables/getUserMedia.mdx) | Get MediaStream with provided [input constraints](interfaces/MediaDeviceRequest.mdx) |
|
|
305
|
+
| [setDefaultConstraints](variables/setDefaultConstraints.mdx) | Set default media stream constraints |
|
|
306
|
+
| [subscribe](variables/subscribe.mdx) | Subscribe media events |
|
|
307
|
+
| [isAudioInput](variables/isAudioInput.mdx) | - |
|
|
308
|
+
| [isVideoInput](variables/isVideoInput.mdx) | - |
|
|
309
|
+
| [isAudioOutput](variables/isAudioOutput.mdx) | - |
|
|
310
|
+
|
|
311
|
+
## Functions
|
|
312
|
+
|
|
313
|
+
| Function | Description |
|
|
314
|
+
| ------ | ------ |
|
|
315
|
+
| [isExactDeviceConstraint](functions/isExactDeviceConstraint.mdx) | Check if provided constraint is an `exact` device constraint |
|
|
316
|
+
| [mergeConstraints](functions/mergeConstraints.mdx) | Merge base constraints with provided base constraints and another constraints |
|
|
317
|
+
| [extractConstrainDevice](functions/extractConstrainDevice.mdx) | - |
|
|
318
|
+
| [getValueFromConstrainNumber](functions/getValueFromConstrainNumber.mdx) | - |
|
|
319
|
+
| [getFacingModeFromConstraintString](functions/getFacingModeFromConstraintString.mdx) | - |
|
|
320
|
+
| [resolveMediaDeviceConstraints](functions/resolveMediaDeviceConstraints.mdx) | Resolve *constraints* and mediaTrackConstraints by checking the type and try to return the best possible from mediaTrackConstraints. |
|
|
321
|
+
| [applyConstraints](functions/applyConstraints.mdx) | Call applyConstraints foreach track accordingly |
|
|
322
|
+
| [extractConstraintsWithKeys](functions/extractConstraintsWithKeys.mdx) | Extract the constraints with provided keys |
|
|
323
|
+
| [findDeviceFromConstraints](functions/findDeviceFromConstraints.mdx) | Find device from the device list with provided constraints |
|
|
324
|
+
| [relaxInputConstraint](functions/relaxInputConstraint.mdx) | Relax input constraints to enable looking up the device by `deviceId` as well as `label` as a fallback as a best effort to get a similar device when possible. If the the device is found we will use the `exact` constraint otherwise we will use the `ideal`. |
|
|
325
|
+
| [toKey](functions/toKey.mdx) | Convert provided info to key for Map |
|
|
326
|
+
| [toMediaDeviceInputKind](functions/toMediaDeviceInputKind.mdx) | - |
|
|
327
|
+
| [getDevices](functions/getDevices.mdx) | Future proofing: in case we want to alter the values or type returned by [enumerateDevices](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/enumerateDevices) |
|
|
328
|
+
| [createTrackDevicesChanges](functions/createTrackDevicesChanges.mdx) | - |
|
|
329
|
+
| [deviceChanged](functions/deviceChanged.mdx) | Unified interface for subscribing [DeviceChangedChanges](type-aliases/DeviceChangedChanges.mdx) Event |
|
|
330
|
+
| [toMediaDeviceInfoLike](functions/toMediaDeviceInfoLike.mdx) | Convert `MediaStreamTrack` to `MediaDeviceInfoLike` |
|
|
331
|
+
| [toMediaDeviceInfo](functions/toMediaDeviceInfo.mdx) | - |
|
|
332
|
+
| [findMediaInputFromMediaStreamTrack](functions/findMediaInputFromMediaStreamTrack.mdx) | Find the MediaDeviceInfo from provided MediaDeviceInfo[] by comparing with provided MediaStreamTrack |
|
|
333
|
+
| [findMediaInputFromStream](functions/findMediaInputFromStream.mdx) | Find media input from media stream |
|
|
334
|
+
| [isRequestedResolution](functions/isRequestedResolution.mdx) | - |
|
|
335
|
+
| [isRequestedInputDevice](functions/isRequestedInputDevice.mdx) | - |
|
|
336
|
+
| [isRequestedInputTrack](functions/isRequestedInputTrack.mdx) | Compare request and the input to see if the request has been fulfilled |
|
|
337
|
+
| [hasRequestingDevice](functions/hasRequestingDevice.mdx) | Check if there is a requesting device with respecting to the current devices |
|
|
338
|
+
| [isTrackMutedOrEnded](functions/isTrackMutedOrEnded.mdx) | Check if the track is muted or 'ended' |
|
|
339
|
+
| [shouldRequestDevice](functions/shouldRequestDevice.mdx) | Decide if we should send a new gUM request |
|
|
340
|
+
| [isStreamingRequestingDevice](functions/isStreamingRequestingDevice.mdx) | - |
|
|
341
|
+
| [isStreamingRequestedDevicesBase](functions/isStreamingRequestedDevicesBase.mdx) | - |
|
|
342
|
+
| [isStreamingRequestedDevices](functions/isStreamingRequestedDevices.mdx) | Check if provided request has already been fulfilled |
|
|
343
|
+
| [findPermissionGrantedDevices](functions/findPermissionGrantedDevices.mdx) | Find in the list of devices which has permissions granted |
|
|
344
|
+
| [getInputDevicePermissionState](functions/getInputDevicePermissionState.mdx) | A wrapper for `navigator.permissions.query` with fallback to use `navigator.mediaDevices.enumerateDevices` to guess the `PermissionState` |
|
|
345
|
+
| [findCurrentAudioOutputId](functions/findCurrentAudioOutputId.mdx) | Find current audio output id to be used to set as sinkId |
|
|
346
|
+
| [findCurrentVideoInputDeviceIdFromStream](functions/findCurrentVideoInputDeviceIdFromStream.mdx) | Find videoinput device id in the stream |
|
|
347
|
+
| [findDeviceWithDeviceId](functions/findDeviceWithDeviceId.mdx) | Finds device with given deviceId |
|
|
348
|
+
| [findDevicesByKind](functions/findDevicesByKind.mdx) | Find in the list of devices with given MediaDeviceKind |
|
|
349
|
+
| [muteStreamTrack](functions/muteStreamTrack.mdx) | Set `MediaStreamTrack['enabled']` according to `mute` param for the provided `stream` |
|
|
350
|
+
| [stopMediaStream](functions/stopMediaStream.mdx) | Stops all tracks in the given stream |
|
|
351
|
+
| [areTracksEnabled](functions/areTracksEnabled.mdx) | Checks that tracks with a given type are enabled in the stream |
|
|
352
|
+
| [hasAudioOrVideoInputs](functions/hasAudioOrVideoInputs.mdx) | Check if list contains media inputs |
|
|
353
|
+
| [hasAudioInputs](functions/hasAudioInputs.mdx) | Check if list contains audio inputs |
|
|
354
|
+
| [hasVideoInputs](functions/hasVideoInputs.mdx) | Check if list contains video inputs |
|
|
355
|
+
| [hasAnyGrantedInput](functions/hasAnyGrantedInput.mdx) | Check if provided devices have any granted input device |
|
|
356
|
+
| [hasAnyInputs](functions/hasAnyInputs.mdx) | Check if provided devices have any video and audio inputs |
|
|
357
|
+
| [hasChangedInput](functions/hasChangedInput.mdx) | An utility function to check the input device has been changed |
|
|
358
|
+
| [areMultipleFacingModeSupported](functions/areMultipleFacingModeSupported.mdx) | An utility function to check if facing mode is supported by interpreting the device label and the API `getSupportedConstraints` |
|
|
359
|
+
| [interpretCurrentFacingMode](functions/interpretCurrentFacingMode.mdx) | Interpret the current facing mode from the provided track, and try to get the mode from settings, or use the label to guess the facing mode when facingMode is not supported from settings |
|
|
360
|
+
| [limitSharingMonitorInterface](functions/limitSharingMonitorInterface.mdx) | A fallback implementation of `monitorTypeSurfaces` limitation when it is not supported by the current browser and the source of the `displaySurface` is available. |
|
|
361
|
+
| [setLogger](functions/setLogger.mdx) | - |
|
|
362
|
+
| [createStreamTrackEventSubscriptions](functions/createStreamTrackEventSubscriptions.mdx) | Create a MediaStreamTrack's native events subscription |
|
|
363
|
+
| [isMediaDeviceInfo](functions/isMediaDeviceInfo.mdx) | Check if provided is `MediaDeviceInfo` |
|
|
364
|
+
| [isMediaDeviceInfoArray](functions/isMediaDeviceInfoArray.mdx) | - |
|
|
365
|
+
| [isInputConstraintSet](functions/isInputConstraintSet.mdx) | - |
|
|
366
|
+
| [isMediaStreamTrack](functions/isMediaStreamTrack.mdx) | Check if provided is `MediaStreamTrack` |
|
|
367
|
+
| [isFacingMode](functions/isFacingMode.mdx) | - |
|
|
368
|
+
| [isIndexedDevices](functions/isIndexedDevices.mdx) | - |
|
|
369
|
+
| [isDeviceGranted](functions/isDeviceGranted.mdx) | Check if provided device is a permission-granted device by inspecting the device label |
|
|
370
|
+
| [getDeviceId](functions/getDeviceId.mdx) | Create a device ID from provided `device`. The device ID here is in the format of `deviceId:kind`, be default. |
|
|
371
|
+
| [reverseDeviceId](functions/reverseDeviceId.mdx) | Reverse the device ID to its original form i.e. `MediaDeviceInfo` The device ID here is in the format of `groupId:deviceId:kind`, be default. |
|
|
372
|
+
| [createIndexedDevices](functions/createIndexedDevices.mdx) | Create an `IndexedDevices` construct from provided `devices` which index the device by device ID or kind. |
|
|
373
|
+
| [compareDevices](functions/compareDevices.mdx) | Compare 2 devices to see if they are the same by `deviceId` or `label` as a fallback |
|
|
374
|
+
| [findDevice](functions/findDevice.mdx) | Lookup the `device` from `devices` list |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
**`Beta`**
|
|
2
|
+
|
|
3
|
+
An enum of failure events for media device
|
|
4
|
+
|
|
5
|
+
## Enumeration Members
|
|
6
|
+
|
|
7
|
+
| Enumeration Member | Value | Description |
|
|
8
|
+
| ------ | ------ | ------ |
|
|
9
|
+
| <a id="aborterror"></a> `AbortError` | `"AbortError"` | **`Beta`** some problem (not user or permissions) occurred which prevented the device from being used. |
|
|
10
|
+
| <a id="audioandvideodevicenotfounderror"></a> `AudioAndVideoDeviceNotFoundError` | `"AudioAndVideoDeviceNotFoundError"` | **`Beta`** Custom error for when selected audio and video device is not found |
|
|
11
|
+
| <a id="audioinputdevicenotfounderror"></a> `AudioInputDeviceNotFoundError` | `"AudioInputDeviceNotFoundError"` | **`Beta`** Custom error for selected audio device not found |
|
|
12
|
+
| <a id="missingconstraintserror"></a> `MissingConstraintsError` | `"MissingConstraintsError"` | **`Beta`** Custom missing constraints error |
|
|
13
|
+
| <a id="notallowederror"></a> `NotAllowedError` | `"NotAllowedError"` | **`Beta`** user has blocked access |
|
|
14
|
+
| <a id="notfounderror"></a> `NotFoundError` | `"NotFoundError"` | **`Beta`** the media tracks doesn't match the constraints |
|
|
15
|
+
| <a id="notreadableerror"></a> `NotReadableError` | `"NotReadableError"` | **`Beta`** hardware failure after user granted access |
|
|
16
|
+
| <a id="overconstrainederror"></a> `OverconstrainedError` | `"OverconstrainedError"` | **`Beta`** no devices met the criteria for the constraints |
|
|
17
|
+
| <a id="permissiondeniederror"></a> `PermissionDeniedError` | `"PermissionDeniedError"` | **`Beta`** user has blocked access old chrome |
|
|
18
|
+
| <a id="securityerror"></a> `SecurityError` | `"SecurityError"` | **`Beta`** User media support disabled by agent |
|
|
19
|
+
| <a id="trackstarterror"></a> `TrackStartError` | `"TrackStartError"` | **`Beta`** when hardware in use old chrome win os |
|
|
20
|
+
| <a id="typeerror"></a> `TypeError` | `"TypeError"` | **`Beta`** GetUserMedia invalid constraints error |
|
|
21
|
+
| <a id="videoinputdevicenotfounderror"></a> `VideoInputDeviceNotFoundError` | `"VideoInputDeviceNotFoundError"` | **`Beta`** Custom error for selected video device not found |
|
|
22
|
+
| <a id="notsupportederror"></a> `NotSupportedError` | `"NotSupportedError"` | **`Beta`** action or function is not supported by the current platform |
|
|
23
|
+
| <a id="streamtracknotfound"></a> `StreamTrackNotFound` | `"StreamTrackNotFound"` | **`Beta`** Canvas capture is not supported |
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
**`Beta`**
|
|
2
|
+
|
|
3
|
+
an enum of MediaDeviceKind which can be reused
|
|
4
|
+
|
|
5
|
+
## Enumeration Members
|
|
6
|
+
|
|
7
|
+
| Enumeration Member | Value | Description |
|
|
8
|
+
| ------ | ------ | ------ |
|
|
9
|
+
| <a id="audioinput"></a> `AUDIOINPUT` | `"audioinput"` | **`Beta`** audio input |
|
|
10
|
+
| <a id="audiooutput"></a> `AUDIOOUTPUT` | `"audiooutput"` | **`Beta`** audio output |
|
|
11
|
+
| <a id="videoinput"></a> `VIDEOINPUT` | `"videoinput"` | **`Beta`** video input |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
**`Beta`**
|
|
2
|
+
|
|
3
|
+
MediaStreamTrack Events
|
|
4
|
+
|
|
5
|
+
## Remarks
|
|
6
|
+
|
|
7
|
+
See MDN [Events](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack#Events)
|
|
8
|
+
|
|
9
|
+
## Enumeration Members
|
|
10
|
+
|
|
11
|
+
| Enumeration Member | Value | Description |
|
|
12
|
+
| ------ | ------ | ------ |
|
|
13
|
+
| <a id="mute"></a> `Mute` | `"mute"` | **`Beta`** Sent to the MediaStreamTrack when the value of the muted property is changed to true, indicating that the track is unable to provide data temporarily (such as when the network is experiencing a service malfunction). |
|
|
14
|
+
| <a id="unmute"></a> `Unmute` | `"unmute"` | **`Beta`** Sent to the track when data becomes available again, ending the muted state. |
|
|
15
|
+
| <a id="ended"></a> `Ended` | `"ended"` | **`Beta`** Sent when playback of the track ends (when the value readyState changes to ended). |
|
|
16
|
+
| <a id="deviceschanged"></a> `DevicesChanged` | `"devices:changed"` | **`Beta`** Fired when a media input or output device is attached to or removed from the user's computer. **Remarks** See MDN [Events](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices#Events) |
|
|
17
|
+
| <a id="devicesfound"></a> `DevicesFound` | `"devices:found"` | **`Beta`** Found new devices from authorized device list |
|
|
18
|
+
| <a id="deviceslost"></a> `DevicesLost` | `"devices:lost"` | **`Beta`** Lost devices from authorized device list |
|
|
19
|
+
| <a id="devicelost"></a> `DeviceLost` | `"device:lost"` | **`Beta`** Lost device from authorized device list |
|
|
20
|
+
| <a id="noinputdevices"></a> `NoInputDevices` | `"devices:noinput"` | **`Beta`** No Input Devices, and no further device events will be emitted |
|
|
21
|
+
| <a id="error"></a> `Error` | `"error"` | **`Beta`** Other errors |
|
|
22
|
+
| <a id="stream"></a> `Stream` | `"stream"` | **`Beta`** When stream |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function applyConstraints(tracks, constraints): Promise<void>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Call applyConstraints foreach track accordingly
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `tracks` | `MediaStreamTrack`[] \| `undefined` | Tracks to be applied |
|
|
12
|
+
| `constraints` | [`MediaDeviceRequest`](../interfaces/MediaDeviceRequest.mdx) | constraints to be applied |
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
`Promise`\<`void`\>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function areMultipleFacingModeSupported(currentDevices, getSupportedConstraints): boolean;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
An utility function to check if facing mode is supported by interpreting the
|
|
6
|
+
device label and the API `getSupportedConstraints`
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
| Parameter | Type | Description |
|
|
11
|
+
| ------ | ------ | ------ |
|
|
12
|
+
| `currentDevices` | [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)[] | Current list of devices available |
|
|
13
|
+
| `getSupportedConstraints` | () => `MediaTrackSupportedConstraints` | A function to get supported constraints, i.e. `navigator.mediaDevices.getSupportedConstraints()` |
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`boolean`
|
|
18
|
+
|
|
19
|
+
## Remarks
|
|
20
|
+
|
|
21
|
+
Only support snooping the label for English
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function areTracksEnabled(stream, type): boolean;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
**`Beta`**
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type |
|
|
10
|
+
| ------ | ------ |
|
|
11
|
+
| `stream` | `MediaStream` \| `undefined` |
|
|
12
|
+
| `type` | `"audio"` \| `"video"` |
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
`boolean`
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function compareDevices(deviceInfo, key): (anotherDeviceInfo) => boolean;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
**`Beta`**
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Default value |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `deviceInfo` | [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx) | `undefined` |
|
|
12
|
+
| `key` | `"toJSON"` \| `"deviceId"` \| `"groupId"` \| `"label"` | `'deviceId'` |
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
(anotherDeviceInfo): boolean;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Parameters
|
|
21
|
+
|
|
22
|
+
| Parameter | Type |
|
|
23
|
+
| ------ | ------ |
|
|
24
|
+
| `anotherDeviceInfo` | [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx) |
|
|
25
|
+
|
|
26
|
+
### Returns
|
|
27
|
+
|
|
28
|
+
`boolean`
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createIndexedDevices(devices): IndexedDevices;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create an `IndexedDevices` construct from provided `devices` which index the
|
|
6
|
+
device by device ID or kind.
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
| Parameter | Type |
|
|
11
|
+
| ------ | ------ |
|
|
12
|
+
| `devices` | [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)[] |
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
[`IndexedDevices`](../interfaces/IndexedDevices.mdx)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createStreamTrackEventSubscriptions(track, handlers): Unsubscribe;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create a MediaStreamTrack's native events subscription
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `track` | `MediaStreamTrack` | The track used for the subscription |
|
|
12
|
+
| `handlers` | [`StreamTrackEventHandlers`](../interfaces/StreamTrackEventHandlers.mdx) | An object contains the event handlers |
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
[`Unsubscribe`](../type-aliases/Unsubscribe.mdx)
|
|
17
|
+
|
|
18
|
+
## See
|
|
19
|
+
|
|
20
|
+
https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack#events
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createTrackDevicesChanges(prevDevices): (devices) => object;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Parameter | Type | Default value |
|
|
8
|
+
| ------ | ------ | ------ |
|
|
9
|
+
| `prevDevices` | [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)[] | `[]` |
|
|
10
|
+
|
|
11
|
+
## Returns
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
(devices): object;
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Parameters
|
|
18
|
+
|
|
19
|
+
| Parameter | Type |
|
|
20
|
+
| ------ | ------ |
|
|
21
|
+
| `devices` | [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)[] |
|
|
22
|
+
|
|
23
|
+
### Returns
|
|
24
|
+
|
|
25
|
+
`object`
|
|
26
|
+
|
|
27
|
+
| Name | Type |
|
|
28
|
+
| ------ | ------ |
|
|
29
|
+
| `found` | [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)[] |
|
|
30
|
+
| `lost` | [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)[] |
|
|
31
|
+
| `devices` | [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)[] |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function deviceChanged(fn): () => void;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
**`Beta`**
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type |
|
|
10
|
+
| ------ | ------ |
|
|
11
|
+
| `fn` | (`event`) => `void` |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
(): void;
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Returns
|
|
20
|
+
|
|
21
|
+
`void`
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function extractConstrainDevice(constraints, initialParam): ConstrainNoneTuple | ConstrainDeviceTuple;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Parameter | Type | Default value |
|
|
8
|
+
| ------ | ------ | ------ |
|
|
9
|
+
| `constraints` | \| [`InputDeviceConstraint`](../type-aliases/InputDeviceConstraint.mdx) \| `undefined` | `undefined` |
|
|
10
|
+
| `initialParam` | `"exact"` \| `"ideal"` | `'ideal'` |
|
|
11
|
+
|
|
12
|
+
## Returns
|
|
13
|
+
|
|
14
|
+
`ConstrainNoneTuple` \| `ConstrainDeviceTuple`
|