@pexip/media-control 20.3.4 → 20.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -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,51 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
type Events =
|
|
3
|
+
| {
|
|
4
|
+
id: string;
|
|
5
|
+
type: Mute;
|
|
6
|
+
}
|
|
7
|
+
| {
|
|
8
|
+
id: string;
|
|
9
|
+
type: Unmute;
|
|
10
|
+
}
|
|
11
|
+
| {
|
|
12
|
+
id: string;
|
|
13
|
+
type: Ended;
|
|
14
|
+
}
|
|
15
|
+
| {
|
|
16
|
+
devices: MediaDeviceInfoLike[];
|
|
17
|
+
type: DevicesChanged;
|
|
18
|
+
}
|
|
19
|
+
| {
|
|
20
|
+
devices: MediaDeviceInfoLike[];
|
|
21
|
+
devicesFound: MediaDeviceInfoLike[];
|
|
22
|
+
type: DevicesFound;
|
|
23
|
+
}
|
|
24
|
+
| {
|
|
25
|
+
devices: MediaDeviceInfoLike[];
|
|
26
|
+
devicesLost: MediaDeviceInfoLike[];
|
|
27
|
+
type: DevicesLost;
|
|
28
|
+
}
|
|
29
|
+
| {
|
|
30
|
+
devices: MediaDeviceInfoLike[];
|
|
31
|
+
type: NoInputDevices;
|
|
32
|
+
}
|
|
33
|
+
| {
|
|
34
|
+
device: MediaDeviceInfoLike;
|
|
35
|
+
type: DeviceLost;
|
|
36
|
+
}
|
|
37
|
+
| {
|
|
38
|
+
error: Error;
|
|
39
|
+
type: Error;
|
|
40
|
+
}
|
|
41
|
+
| {
|
|
42
|
+
facingMode: boolean;
|
|
43
|
+
stream: MediaStream;
|
|
44
|
+
type: Stream;
|
|
45
|
+
video: boolean;
|
|
46
|
+
};
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**`Beta`**
|
|
50
|
+
|
|
51
|
+
Event object by MediaEventType
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
type MediaDeviceInfoLike = Omit<MediaDeviceInfo, "toJSON"> & object;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
**`Beta`**
|
|
6
|
+
|
|
7
|
+
A striped version of MediaDeviceInfo
|
|
8
|
+
|
|
9
|
+
## Type Declaration
|
|
10
|
+
|
|
11
|
+
| Name | Type |
|
|
12
|
+
| ------ | ------ |
|
|
13
|
+
| `toJSON?` | `MediaDeviceInfo`\[`"toJSON"`\] |
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
const CURSOR_CAPTURE_CONSTRAINT: object;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
The `CursorCaptureConstraint` enumerates the conditions under which the
|
|
6
|
+
cursor is captured.
|
|
7
|
+
|
|
8
|
+
## Type Declaration
|
|
9
|
+
|
|
10
|
+
| Name | Type | Default value |
|
|
11
|
+
| ------ | ------ | ------ |
|
|
12
|
+
| <a id="never"></a> `Never` | `"never"` | `'never'` |
|
|
13
|
+
| <a id="always"></a> `Always` | `"always"` | `'always'` |
|
|
14
|
+
| <a id="motion"></a> `Motion` | `"motion"` | `'motion'` |
|
|
15
|
+
|
|
16
|
+
## See
|
|
17
|
+
|
|
18
|
+
[https://w3c.github.io/mediacapture-screen-share/#cursorcaptureconstraint](https://w3c.github.io/mediacapture-screen-share/#cursorcaptureconstraint)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
const DISPLAY_CAPTURE_SURFACE_TYPE: object;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
The `DisplayCaptureSurfaceType` enumeration describes the different types of
|
|
6
|
+
display surface
|
|
7
|
+
|
|
8
|
+
## Type Declaration
|
|
9
|
+
|
|
10
|
+
| Name | Type | Default value |
|
|
11
|
+
| ------ | ------ | ------ |
|
|
12
|
+
| <a id="monitor"></a> `Monitor` | `"monitor"` | `'monitor'` |
|
|
13
|
+
| <a id="window"></a> `Window` | `"window"` | `'window'` |
|
|
14
|
+
| <a id="browser"></a> `Browser` | `"browser"` | `'browser'` |
|
|
15
|
+
|
|
16
|
+
## See
|
|
17
|
+
|
|
18
|
+
[https://w3c.github.io/mediacapture-screen-share/#displaycapturesurfacetype](https://w3c.github.io/mediacapture-screen-share/#displaycapturesurfacetype)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
const INCLUDE_EXCLUDE_CONSTRAINT: object;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Type Declaration
|
|
6
|
+
|
|
7
|
+
| Name | Type | Default value |
|
|
8
|
+
| ------ | ------ | ------ |
|
|
9
|
+
| <a id="include"></a> `Include` | `"include"` | `'include'` |
|
|
10
|
+
| <a id="exclude"></a> `Exclude` | `"exclude"` | `'exclude'` |
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
const findAudioInputDevices: (devices) => MediaDeviceInfoLike[];
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
**`Beta`**
|
|
6
|
+
|
|
7
|
+
Find in the list of devices only the audio input ones
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
| Parameter | Type | Description |
|
|
12
|
+
| ------ | ------ | ------ |
|
|
13
|
+
| `devices` | [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)[] | A list of media devices from `navigator.mediaDevices.enumerateDevices()`. Will be used for search target |
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
[`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)[]
|
|
18
|
+
|
|
19
|
+
List of devices that are audio inputs
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
const findAudioOutputDevices: (devices) => MediaDeviceInfoLike[];
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
**`Beta`**
|
|
6
|
+
|
|
7
|
+
Find in the list of devices only the audio output ones
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
| Parameter | Type | Description |
|
|
12
|
+
| ------ | ------ | ------ |
|
|
13
|
+
| `devices` | [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)[] | A list of media devices from `navigator.mediaDevices.enumerateDevices()`. Will be used for search target |
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
[`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)[]
|
|
18
|
+
|
|
19
|
+
List of devices that are audio outputs
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
const findVideoInputDevices: (devices) => MediaDeviceInfoLike[];
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
**`Beta`**
|
|
6
|
+
|
|
7
|
+
Find in the list of devices only the video input ones
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
| Parameter | Type | Description |
|
|
12
|
+
| ------ | ------ | ------ |
|
|
13
|
+
| `devices` | [`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)[] | A list of media devices from `navigator.mediaDevices.enumerateDevices()`. Will be used for search target |
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
[`MediaDeviceInfoLike`](../type-aliases/MediaDeviceInfoLike.mdx)[]
|
|
18
|
+
|
|
19
|
+
List of devices that are video inputs
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
getUserMedia: (__namedParameters) => Promise<MediaStream>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Get MediaStream with provided [input constraints](../interfaces/MediaDeviceRequest.mdx)
|
|
6
|
+
|
|
7
|
+
**`Beta`**
|
|
8
|
+
|
|
9
|
+
Get MediaStream with MediaDeviceRequest
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
| Parameter | Type |
|
|
14
|
+
| ------ | ------ |
|
|
15
|
+
| `__namedParameters` | [`MediaDeviceRequest`](../interfaces/MediaDeviceRequest.mdx) |
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
`Promise`\<`MediaStream`\>
|
|
20
|
+
|
|
21
|
+
MediaStream
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
setDefaultConstraints: (newConstraints) => void;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Set default media stream constraints
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
| Parameter | Type |
|
|
12
|
+
| ------ | ------ |
|
|
13
|
+
| `newConstraints` | `MediaStreamConstraints` |
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`void`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
subscribe: (listener) => () => void;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Subscribe media events
|
|
6
|
+
|
|
7
|
+
**`Beta`**
|
|
8
|
+
|
|
9
|
+
Subscription media events
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
| Parameter | Type |
|
|
14
|
+
| ------ | ------ |
|
|
15
|
+
| `listener` | (`event`) => `void` |
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
(): void;
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Returns
|
|
24
|
+
|
|
25
|
+
`void`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pexip/media-control",
|
|
3
|
-
"version": "20.3.
|
|
3
|
+
"version": "20.3.5",
|
|
4
4
|
"homepage": "https://gitlab.com/pexip/zoo",
|
|
5
5
|
"bugs": "https://gitlab.com/pexip/zoo/issues",
|
|
6
6
|
"repository": {
|
|
@@ -27,27 +27,32 @@
|
|
|
27
27
|
"import": "./dist/*.js"
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
|
+
"directories": {
|
|
31
|
+
"doc": "api-docs"
|
|
32
|
+
},
|
|
30
33
|
"files": [
|
|
31
|
-
"dist"
|
|
34
|
+
"dist",
|
|
35
|
+
"api-docs"
|
|
32
36
|
],
|
|
33
37
|
"scripts": {
|
|
34
|
-
"build": "pexip-bundler build",
|
|
35
|
-
"build:sourcemap": "pexip-bundler build --sourcemap",
|
|
36
|
-
"clean": "rm -rf dist",
|
|
38
|
+
"build": "pexip-bundler build && yarn docs",
|
|
39
|
+
"build:sourcemap": "pexip-bundler build --sourcemap && yarn docs",
|
|
40
|
+
"clean": "rm -rf dist api-docs",
|
|
37
41
|
"dev": "pexip-bundler dev",
|
|
38
42
|
"prepack": "yarn clean && yarn build",
|
|
39
43
|
"test": "jest",
|
|
40
44
|
"check-format": "prettier --ignore-path=../../.prettierignore --check .",
|
|
41
45
|
"format": "prettier --ignore-path=../../.prettierignore --write .",
|
|
42
46
|
"lint": "yarn run -T biome lint",
|
|
43
|
-
"typecheck": "yarn tsc --noEmit -p tsconfig.build.json"
|
|
47
|
+
"typecheck": "yarn tsc --noEmit -p tsconfig.build.json",
|
|
48
|
+
"docs": "typedoc"
|
|
44
49
|
},
|
|
45
50
|
"dependencies": {
|
|
46
|
-
"@pexip/utils": "17.1.
|
|
51
|
+
"@pexip/utils": "17.1.3"
|
|
47
52
|
},
|
|
48
53
|
"devDependencies": {
|
|
49
54
|
"@jest/globals": "^30.2.0",
|
|
50
|
-
"@pexip/bundler": "18.
|
|
55
|
+
"@pexip/bundler": "18.2.0",
|
|
51
56
|
"@swc/core": "^1.10.12",
|
|
52
57
|
"@swc/jest": "^0.2.39",
|
|
53
58
|
"@types/uuid": "^8.3.0",
|
|
@@ -55,6 +60,8 @@
|
|
|
55
60
|
"jest": "^29.5.12",
|
|
56
61
|
"jest-junit": "^16.0.0",
|
|
57
62
|
"prettier": "^3.2.5",
|
|
63
|
+
"typedoc": "^0.28.15",
|
|
64
|
+
"typedoc-plugin-markdown": "^4.9.0",
|
|
58
65
|
"typescript": "~5.7.3",
|
|
59
66
|
"uuid": "^11.0.0"
|
|
60
67
|
},
|