@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
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function isStreamingRequestedDevices(
|
|
3
|
+
request,
|
|
4
|
+
stream,
|
|
5
|
+
devices): object;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Check if provided request has already been fulfilled
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| Parameter | Type | Description |
|
|
13
|
+
| ------ | ------ | ------ |
|
|
14
|
+
| `request` | [`MediaDeviceRequest`](../interfaces/MediaDeviceRequest.mdx) | A media request constraints |
|
|
15
|
+
| `stream` | `MediaStream` \| `undefined` | Current media stream |
|
|
16
|
+
| `devices` | [`IndexedDevices`](../interfaces/IndexedDevices.mdx) | - |
|
|
17
|
+
|
|
18
|
+
## Returns
|
|
19
|
+
|
|
20
|
+
`object`
|
|
21
|
+
|
|
22
|
+
audio - The stream is using the same device as requested if `true`
|
|
23
|
+
video - The stream is using the same device as requested if `true`
|
|
24
|
+
|
|
25
|
+
| Name | Type |
|
|
26
|
+
| ------ | ------ |
|
|
27
|
+
| `audio` | `boolean` |
|
|
28
|
+
| `video` | `boolean` |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function isStreamingRequestedDevicesBase(
|
|
3
|
+
request,
|
|
4
|
+
tracksOrDevices,
|
|
5
|
+
devices): object;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
| Parameter | Type |
|
|
11
|
+
| ------ | ------ |
|
|
12
|
+
| `request` | [`MediaDeviceRequest`](../interfaces/MediaDeviceRequest.mdx) |
|
|
13
|
+
| `tracksOrDevices` | \{ `audio?`: \| [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx) \| `MediaStreamTrack`[]; `video?`: \| [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx) \| `MediaStreamTrack`[]; \} |
|
|
14
|
+
| `tracksOrDevices.audio?` | \| [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx) \| `MediaStreamTrack`[] |
|
|
15
|
+
| `tracksOrDevices.video?` | \| [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx) \| `MediaStreamTrack`[] |
|
|
16
|
+
| `devices` | [`IndexedDevices`](../interfaces/IndexedDevices.mdx) |
|
|
17
|
+
|
|
18
|
+
## Returns
|
|
19
|
+
|
|
20
|
+
`object`
|
|
21
|
+
|
|
22
|
+
| Name | Type |
|
|
23
|
+
| ------ | ------ |
|
|
24
|
+
| `audio` | `boolean` |
|
|
25
|
+
| `video` | `boolean` |
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function isStreamingRequestingDevice(
|
|
3
|
+
request,
|
|
4
|
+
trackOrDevice,
|
|
5
|
+
devices): boolean;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
| Parameter | Type |
|
|
11
|
+
| ------ | ------ |
|
|
12
|
+
| `request` | \| [`InputDeviceConstraint`](../type-aliases/InputDeviceConstraint.mdx) \| `undefined` |
|
|
13
|
+
| `trackOrDevice` | \| [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx) \| `MediaStreamTrack`[] \| `undefined` |
|
|
14
|
+
| `devices` | [`IndexedDevices`](../interfaces/IndexedDevices.mdx) |
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
`boolean`
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function isTrackMutedOrEnded(track): boolean;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Check if the track is muted or 'ended'
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `track` | `MediaStreamTrack` | The media stream tracks |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
`boolean`
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function limitSharingMonitorInterface(constraints, stream): MediaStream;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
A fallback implementation of `monitorTypeSurfaces` limitation when it is not
|
|
6
|
+
supported by the current browser and the source of the `displaySurface` is
|
|
7
|
+
available.
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
| Parameter | Type | Description |
|
|
12
|
+
| ------ | ------ | ------ |
|
|
13
|
+
| `constraints` | [`DisplayMediaOptions`](../interfaces/DisplayMediaOptions.mdx) | The constraints used to request display media. |
|
|
14
|
+
| `stream` | `MediaStream` | The MediaStream returned from the requesting display media. |
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
`MediaStream`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function mergeConstraints(baseConstraints): (constraints) =>
|
|
3
|
+
| boolean
|
|
4
|
+
| InputConstraintSet
|
|
5
|
+
| undefined;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Merge base constraints with provided base constraints and another constraints
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| Parameter | Type |
|
|
13
|
+
| ------ | ------ |
|
|
14
|
+
| `baseConstraints` | \| `boolean` \| [`InputConstraintSet`](../interfaces/InputConstraintSet.mdx) \| `undefined` |
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
(constraints):
|
|
20
|
+
| boolean
|
|
21
|
+
| InputConstraintSet
|
|
22
|
+
| undefined;
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Parameters
|
|
26
|
+
|
|
27
|
+
| Parameter | Type |
|
|
28
|
+
| ------ | ------ |
|
|
29
|
+
| `constraints` | \| [`InputDeviceConstraint`](../type-aliases/InputDeviceConstraint.mdx) \| `undefined` |
|
|
30
|
+
|
|
31
|
+
### Returns
|
|
32
|
+
|
|
33
|
+
\| `boolean`
|
|
34
|
+
\| [`InputConstraintSet`](../interfaces/InputConstraintSet.mdx)
|
|
35
|
+
\| `undefined`
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function muteStreamTrack(stream?): (mute, mediaType) => void;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
**`Beta`**
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type |
|
|
10
|
+
| ------ | ------ |
|
|
11
|
+
| `stream?` | `MediaStream` |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
(mute, mediaType): void;
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Parameters
|
|
20
|
+
|
|
21
|
+
| Parameter | Type | Default value |
|
|
22
|
+
| ------ | ------ | ------ |
|
|
23
|
+
| `mute` | `boolean` | `undefined` |
|
|
24
|
+
| `mediaType` | `"audio"` \| `"video"` \| `"all"` | `'all'` |
|
|
25
|
+
|
|
26
|
+
### Returns
|
|
27
|
+
|
|
28
|
+
`void`
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function relaxInputConstraint(
|
|
3
|
+
kind,
|
|
4
|
+
input,
|
|
5
|
+
devices):
|
|
6
|
+
| InputDeviceConstraint
|
|
7
|
+
| undefined;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Relax input constraints to enable looking up the device by `deviceId` as well
|
|
11
|
+
as `label` as a fallback as a best effort to get a similar device when
|
|
12
|
+
possible. If the the device is found we will use the `exact` constraint otherwise
|
|
13
|
+
we will use the `ideal`.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| ------ | ------ | ------ |
|
|
19
|
+
| `kind` | `"audioinput"` \| `"videoinput"` | - |
|
|
20
|
+
| `input` | \| [`InputDeviceConstraint`](../type-aliases/InputDeviceConstraint.mdx) \| `undefined` | The input constraints to be relaxed |
|
|
21
|
+
| `devices` | [`IndexedDevices`](../interfaces/IndexedDevices.mdx) | The current device list |
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
\| [`InputDeviceConstraint`](../type-aliases/InputDeviceConstraint.mdx)
|
|
26
|
+
\| `undefined`
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function resolveMediaDeviceConstraints(constraints?, base?): boolean | MediaTrackConstraints | undefined;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
**`Internal`**
|
|
6
|
+
|
|
7
|
+
Resolve *constraints* and mediaTrackConstraints by checking the type and
|
|
8
|
+
try to return the best possible from mediaTrackConstraints.
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| Parameter | Type |
|
|
13
|
+
| ------ | ------ |
|
|
14
|
+
| `constraints?` | [`InputDeviceConstraint`](../type-aliases/InputDeviceConstraint.mdx) |
|
|
15
|
+
| `base?` | `boolean` \| `MediaTrackConstraints` |
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
`boolean` \| `MediaTrackConstraints` \| `undefined`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function reverseDeviceId(id, separator): object;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Reverse the device ID to its original form i.e. `MediaDeviceInfo`
|
|
6
|
+
The device ID here is in the format of `groupId:deviceId:kind`, be default.
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
| Parameter | Type | Default value | Description |
|
|
11
|
+
| ------ | ------ | ------ | ------ |
|
|
12
|
+
| `id` | `string` | `undefined` | The device ID to reverse |
|
|
13
|
+
| `separator` | `string` | `DEVICE_ID_SEPARATOR` | The separator used to split the device ID |
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`object`
|
|
18
|
+
|
|
19
|
+
| Name | Type |
|
|
20
|
+
| ------ | ------ |
|
|
21
|
+
| `deviceId` | `string` |
|
|
22
|
+
| `kind` | `MediaDeviceKind` |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function shouldRequestDevice(deviceRequestParams): boolean;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Decide if we should send a new gUM request
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `deviceRequestParams` | `DeviceRequestParams` | |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
`boolean`
|
|
16
|
+
|
|
17
|
+
`true` means the request should be conducted, otherwise `false`.
|
|
18
|
+
|
|
19
|
+
## See
|
|
20
|
+
|
|
21
|
+
DeviceRequestParams
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function stopMediaStream(stream, onStopped?): void;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Stops all tracks in the given stream
|
|
6
|
+
|
|
7
|
+
Immediately after calling stop(), the readyState property is set to `ended`.
|
|
8
|
+
Note that the `ended` event will not be fired in this situation
|
|
9
|
+
https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/stop#description
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
| Parameter | Type | Description |
|
|
14
|
+
| ------ | ------ | ------ |
|
|
15
|
+
| `stream` | `MediaStream` \| `undefined` | `MediaStream` which we mutate |
|
|
16
|
+
| `onStopped?` | (`track`) => `void` | callback to be called when the track is stopped |
|
|
17
|
+
|
|
18
|
+
## Returns
|
|
19
|
+
|
|
20
|
+
`void`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function toMediaDeviceInfo(info): object;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Parameter | Type |
|
|
8
|
+
| ------ | ------ |
|
|
9
|
+
| `info` | [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx) |
|
|
10
|
+
|
|
11
|
+
## Returns
|
|
12
|
+
|
|
13
|
+
`object`
|
|
14
|
+
|
|
15
|
+
| Name | Type | Default value |
|
|
16
|
+
| ------ | ------ | ------ |
|
|
17
|
+
| `deviceId` | `string` | `info.deviceId` |
|
|
18
|
+
| `groupId` | `string` | `info.groupId` |
|
|
19
|
+
| `kind` | `MediaDeviceKind` | `info.kind` |
|
|
20
|
+
| `label` | `string` | `info.label` |
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function toMediaDeviceInfoLike(track):
|
|
3
|
+
| MediaDeviceInfoLike
|
|
4
|
+
| undefined;
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
**`Beta`**
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
| Parameter | Type |
|
|
12
|
+
| ------ | ------ |
|
|
13
|
+
| `track` | `MediaStreamTrack` |
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
\| [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)
|
|
18
|
+
\| `undefined`
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function toMediaDeviceInputKind(track): "audioinput" | "videoinput";
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Parameter | Type |
|
|
8
|
+
| ------ | ------ |
|
|
9
|
+
| `track` | `Pick`\<`MediaStreamTrack`, `"kind"`\> |
|
|
10
|
+
|
|
11
|
+
## Returns
|
|
12
|
+
|
|
13
|
+
`"audioinput"` \| `"videoinput"`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The `DisplayMediaStreamOptions` dictionary is used to instruct the user agent
|
|
2
|
+
what sort of `MediaStreamTracks` may be included in the `MediaStream`
|
|
3
|
+
returned by `getDisplayMedia`.
|
|
4
|
+
|
|
5
|
+
## See
|
|
6
|
+
|
|
7
|
+
[https://w3c.github.io/mediacapture-screen-share/#displaymediastreamoptions](https://w3c.github.io/mediacapture-screen-share/#displaymediastreamoptions)
|
|
8
|
+
|
|
9
|
+
## Extends
|
|
10
|
+
|
|
11
|
+
- `DisplayMediaStreamOptions`
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
| Property | Type | Overrides |
|
|
16
|
+
| ------ | ------ | ------ |
|
|
17
|
+
| <a id="audio"></a> `audio?` | `boolean` \| `DisplayAudioTrackConstraints` | `DisplayMediaStreamOptions.audio` |
|
|
18
|
+
| <a id="video"></a> `video?` | `boolean` \| `DisplayVideoTrackConstraints` | `DisplayMediaStreamOptions.video` |
|
|
19
|
+
| <a id="selfbrowsersurface"></a> `selfBrowserSurface?` | `ConstrainDOMString` | - |
|
|
20
|
+
| <a id="systemaudio"></a> `systemAudio?` | `ConstrainDOMString` | - |
|
|
21
|
+
| <a id="surfaceswitching"></a> `surfaceSwitching?` | `ConstrainDOMString` | - |
|
|
22
|
+
| <a id="monitortypesurfaces"></a> `monitorTypeSurfaces?` | `ConstrainDOMString` | - |
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
## Methods
|
|
2
|
+
|
|
3
|
+
### get()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
get(device?): MediaDeviceInfoLike[];
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Get devices by kind and device id or label
|
|
10
|
+
When both `deviceId` and `label` are provided, it will use `deviceId` to
|
|
11
|
+
find the device, and when it's not found, it will use `label` to find
|
|
12
|
+
|
|
13
|
+
When device is not provided, it returns all devices.
|
|
14
|
+
|
|
15
|
+
#### Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| ------ | ------ | ------ |
|
|
19
|
+
| `device?` | `Pick`\<`Partial`\<[`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)\>, `"deviceId"` \| `"groupId"` \| `"kind"` \| `"label"`\> | the device to find |
|
|
20
|
+
|
|
21
|
+
#### Returns
|
|
22
|
+
|
|
23
|
+
[`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)[]
|
|
24
|
+
|
|
25
|
+
found devices otherwise empty array
|
|
26
|
+
|
|
27
|
+
***
|
|
28
|
+
|
|
29
|
+
### size()
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
size(kind?): number;
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Size of particular kind of devices. When kind is not specified, it
|
|
36
|
+
returns the total size.
|
|
37
|
+
|
|
38
|
+
#### Parameters
|
|
39
|
+
|
|
40
|
+
| Parameter | Type |
|
|
41
|
+
| ------ | ------ |
|
|
42
|
+
| `kind?` | `MediaDeviceKind` |
|
|
43
|
+
|
|
44
|
+
#### Returns
|
|
45
|
+
|
|
46
|
+
`number`
|
|
47
|
+
|
|
48
|
+
***
|
|
49
|
+
|
|
50
|
+
### first()
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
first(kind):
|
|
54
|
+
| MediaDeviceInfoLike
|
|
55
|
+
| undefined;
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
First device of the kind
|
|
59
|
+
|
|
60
|
+
#### Parameters
|
|
61
|
+
|
|
62
|
+
| Parameter | Type |
|
|
63
|
+
| ------ | ------ |
|
|
64
|
+
| `kind` | `MediaDeviceKind` |
|
|
65
|
+
|
|
66
|
+
#### Returns
|
|
67
|
+
|
|
68
|
+
\| [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)
|
|
69
|
+
\| `undefined`
|
|
70
|
+
|
|
71
|
+
***
|
|
72
|
+
|
|
73
|
+
### toJSON()
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
toJSON(): Record<MediaDeviceKind, MediaDeviceInfoLike[]>;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### Returns
|
|
80
|
+
|
|
81
|
+
`Record`\<`MediaDeviceKind`, [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)[]\>
|
|
82
|
+
|
|
83
|
+
***
|
|
84
|
+
|
|
85
|
+
### anyAuthorizedDevice()
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
anyAuthorizedDevice(kind?): boolean;
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`true` when there is any authorized device of the kind. When kind is not
|
|
92
|
+
provided, it checks for any audio or video input device.
|
|
93
|
+
|
|
94
|
+
#### Parameters
|
|
95
|
+
|
|
96
|
+
| Parameter | Type |
|
|
97
|
+
| ------ | ------ |
|
|
98
|
+
| `kind?` | `MediaDeviceKind` |
|
|
99
|
+
|
|
100
|
+
#### Returns
|
|
101
|
+
|
|
102
|
+
`boolean`
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
## Extends
|
|
2
|
+
|
|
3
|
+
- `MediaTrackConstraints`
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Type | Description | Inherited from |
|
|
8
|
+
| ------ | ------ | ------ | ------ |
|
|
9
|
+
| <a id="device"></a> `device?` | `DeviceConstraint` \| `ConstraintDeviceParameters` | Same purpose as `deviceId` but it gives more information about the device so that we can have extra tolerance on device selection | - |
|
|
10
|
+
| <a id="videosegmentation"></a> `videoSegmentation?` | `ConstrainDOMString` | Whether or not using video segmentation, e.g. background blur/replacement, to specify the effects, intended to be applied to the segment. Available effects are `none`, `blur`, `overlay` or `remove` | - |
|
|
11
|
+
| <a id="videosegmentationmodel"></a> `videoSegmentationModel?` | `ConstrainDOMString` | Segmentation model to be used for video segmentation, currently only supports `mediapipeSelfie` and `personify` | - |
|
|
12
|
+
| <a id="denoise"></a> `denoise?` | `ConstrainBoolean` | Whether or not using our own noise suppression | - |
|
|
13
|
+
| <a id="vad"></a> `vad?` | `ConstrainBoolean` | Voice Activity Detection | - |
|
|
14
|
+
| <a id="asd"></a> `asd?` | `ConstrainBoolean` | Audio Signal Detection for the purpose of checking if the audio input is hardware muted or unusable | - |
|
|
15
|
+
| <a id="mixwithadditionalmedia"></a> `mixWithAdditionalMedia?` | `ConstrainBoolean` | Audio Signal Detection for the purpose of checking if the audio input is hardware muted or unusable | - |
|
|
16
|
+
| <a id="backgroundbluramount"></a> `backgroundBlurAmount?` | `ConstrainULong` | Blur size/level parameter when using video segmentation with `blur` effects | - |
|
|
17
|
+
| <a id="edgebluramount"></a> `edgeBlurAmount?` | `ConstrainULong` | Blur amount applied to the segmented person's edge | - |
|
|
18
|
+
| <a id="foregroundthreshold"></a> `foregroundThreshold?` | `ConstrainDouble` | Erode level for edge smoothing when using video segmentation | - |
|
|
19
|
+
| <a id="backgroundimageurl"></a> `backgroundImageUrl?` | `ConstrainDOMString` | Image Url that is being used for video overlay effects | - |
|
|
20
|
+
| <a id="maskcombineratio"></a> `maskCombineRatio?` | `ConstrainDouble` | The ratio to be used for smoothing segmentation mask | - |
|
|
21
|
+
| <a id="resizemode"></a> `resizeMode?` | `ConstrainDOMString` | Image Url that is being used for video overlay effects | - |
|
|
22
|
+
| <a id="pan"></a> `pan?` | `boolean` | Current pan, tilt and zoom level for a PTZ controllable camera on web | - |
|
|
23
|
+
| <a id="tilt"></a> `tilt?` | `boolean` | - | - |
|
|
24
|
+
| <a id="zoom"></a> `zoom?` | `boolean` | - | - |
|
|
25
|
+
| <a id="contenthint"></a> `contentHint?` | `ConstrainDOMString` | Content Hint for the track to apply | - |
|
|
26
|
+
| <a id="volume"></a> `volume?` | `ConstrainNumber` | - | `MediaTrackConstraints.volume` |
|
|
27
|
+
| <a id="latency"></a> `latency?` | `ConstrainNumber` | - | `MediaTrackConstraints.latency` |
|
|
28
|
+
| <a id="aspectratio"></a> `aspectRatio?` | `ConstrainDouble` | - | `MediaTrackConstraints.aspectRatio` |
|
|
29
|
+
| <a id="autogaincontrol"></a> `autoGainControl?` | `ConstrainBoolean` | - | `MediaTrackConstraints.autoGainControl` |
|
|
30
|
+
| <a id="backgroundblur"></a> `backgroundBlur?` | `ConstrainBoolean` | - | `MediaTrackConstraints.backgroundBlur` |
|
|
31
|
+
| <a id="channelcount"></a> `channelCount?` | `ConstrainULong` | - | `MediaTrackConstraints.channelCount` |
|
|
32
|
+
| <a id="deviceid"></a> `deviceId?` | `ConstrainDOMString` | - | `MediaTrackConstraints.deviceId` |
|
|
33
|
+
| <a id="displaysurface"></a> `displaySurface?` | `ConstrainDOMString` | - | `MediaTrackConstraints.displaySurface` |
|
|
34
|
+
| <a id="echocancellation"></a> `echoCancellation?` | `ConstrainBoolean` | - | `MediaTrackConstraints.echoCancellation` |
|
|
35
|
+
| <a id="facingmode"></a> `facingMode?` | `ConstrainDOMString` | - | `MediaTrackConstraints.facingMode` |
|
|
36
|
+
| <a id="framerate"></a> `frameRate?` | `ConstrainDouble` | - | `MediaTrackConstraints.frameRate` |
|
|
37
|
+
| <a id="groupid"></a> `groupId?` | `ConstrainDOMString` | - | `MediaTrackConstraints.groupId` |
|
|
38
|
+
| <a id="height"></a> `height?` | `ConstrainULong` | - | `MediaTrackConstraints.height` |
|
|
39
|
+
| <a id="noisesuppression"></a> `noiseSuppression?` | `ConstrainBoolean` | - | `MediaTrackConstraints.noiseSuppression` |
|
|
40
|
+
| <a id="samplerate"></a> `sampleRate?` | `ConstrainULong` | - | `MediaTrackConstraints.sampleRate` |
|
|
41
|
+
| <a id="samplesize"></a> `sampleSize?` | `ConstrainULong` | - | `MediaTrackConstraints.sampleSize` |
|
|
42
|
+
| <a id="width"></a> `width?` | `ConstrainULong` | - | `MediaTrackConstraints.width` |
|
|
43
|
+
| <a id="advanced"></a> `advanced?` | `MediaTrackConstraintSet`[] | - | `MediaTrackConstraints.advanced` |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
**`Beta`**
|
|
2
|
+
|
|
3
|
+
MediaControl Interface
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Type | Description |
|
|
8
|
+
| ------ | ------ | ------ |
|
|
9
|
+
| <a id="devicechanged"></a> `deviceChanged` | (`fn`) => () => `void` | **`Beta`** Unified interface for subscribing [DeviceChangedChanges](../type-aliases/DeviceChangedChanges.mdx) Event |
|
|
10
|
+
| <a id="getdevices"></a> `getDevices` | () => `Promise`\<`MediaDeviceInfo`[]\> | **`Beta`** 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) |
|
|
11
|
+
| <a id="mediaeventtype"></a> `MediaEventType` | *typeof* [`MediaEventType`](../enumerations/MediaEventType.mdx) | **`Beta`** MediaStreamTrack Events **Remarks** See MDN [Events](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack#Events) |
|
|
12
|
+
| <a id="getusermedia"></a> `getUserMedia` | (`__namedParameters`) => `Promise`\<`MediaStream`\> | **`Beta`** Get MediaStream with provided [input constraints](MediaDeviceRequest.mdx) |
|
|
13
|
+
| <a id="setdefaultconstraints"></a> `setDefaultConstraints` | (`newConstraints`) => `void` | **`Beta`** Set default media stream constraints A [MediaStreamConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints) object specifying the types of media to request, along with any requirements for each type. |
|
|
14
|
+
| <a id="subscribe"></a> `subscribe` | (`listener`) => () => `void` | **`Beta`** Subscribe media events |
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
**`Beta`**
|
|
2
|
+
|
|
3
|
+
The request constraints that applies to `getMediaStream`
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Type | Description |
|
|
8
|
+
| ------ | ------ | ------ |
|
|
9
|
+
| <a id="audio"></a> `audio?` | [`InputDeviceConstraint`](../type-aliases/InputDeviceConstraint.mdx) | **`Beta`** Either a Boolean (which indicates whether or not an audio track is requested) or a [MediaDeviceInfoLike](../type-aliases/MediaDeviceInfoLike.mdx) object providing a hint for the audio track included in the returned MediaStream |
|
|
10
|
+
| <a id="video"></a> `video?` | [`InputDeviceConstraint`](../type-aliases/InputDeviceConstraint.mdx) | **`Beta`** Either a Boolean (which indicates whether or not an video track is requested) or a [MediaDeviceInfoLike](../type-aliases/MediaDeviceInfoLike.mdx) object providing a hint for the video track included in the returned MediaStream |
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
**`Beta`**
|
|
2
|
+
|
|
3
|
+
Holds user media input devices
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Type | Description |
|
|
8
|
+
| ------ | ------ | ------ |
|
|
9
|
+
| <a id="audioinput"></a> `audioInput?` | [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx) | **`Beta`** |
|
|
10
|
+
| <a id="videoinput"></a> `videoInput?` | [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx) | **`Beta`** |
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
An object contains the event handlers
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Property | Type |
|
|
6
|
+
| ------ | ------ |
|
|
7
|
+
| <a id="ended"></a> `ended?` | `TrackEventCallback` |
|
|
8
|
+
| <a id="mute"></a> `mute?` | `TrackEventCallback` |
|
|
9
|
+
| <a id="unmute"></a> `unmute?` | `TrackEventCallback` |
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
type CursorCaptureConstraint = ExtractObjectValueTypes<typeof CURSOR_CAPTURE_CONSTRAINT>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
The `CursorCaptureConstraint` enumerates the conditions under which the
|
|
6
|
+
cursor is captured.
|
|
7
|
+
|
|
8
|
+
## See
|
|
9
|
+
|
|
10
|
+
[https://w3c.github.io/mediacapture-screen-share/#cursorcaptureconstraint](https://w3c.github.io/mediacapture-screen-share/#cursorcaptureconstraint)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
type DeviceChangedChanges = object;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
**`Beta`**
|
|
6
|
+
|
|
7
|
+
DeviceChange Event
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
devices (raw)
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
| Property | Type |
|
|
16
|
+
| ------ | ------ |
|
|
17
|
+
| <a id="found"></a> `found` | [`MediaDeviceInfoLike`](MediaDeviceInfoLike.mdx)[] |
|
|
18
|
+
| <a id="lost"></a> `lost` | [`MediaDeviceInfoLike`](MediaDeviceInfoLike.mdx)[] |
|
|
19
|
+
| <a id="devices"></a> `devices` | [`MediaDeviceInfoLike`](MediaDeviceInfoLike.mdx)[] |
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
type DisplayCaptureSurfaceType = ExtractObjectValueTypes<typeof DISPLAY_CAPTURE_SURFACE_TYPE>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
The `DisplayCaptureSurfaceType` enumeration describes the different types of
|
|
6
|
+
display surface
|
|
7
|
+
|
|
8
|
+
## See
|
|
9
|
+
|
|
10
|
+
[https://w3c.github.io/mediacapture-screen-share/#displaycapturesurfacetype](https://w3c.github.io/mediacapture-screen-share/#displaycapturesurfacetype)
|