@pexip/media 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.
Files changed (98) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/api-docs/README.mdx +404 -0
  3. package/api-docs/enumerations/DeniedDevices.mdx +7 -0
  4. package/api-docs/enumerations/UserMediaStatus.mdx +49 -0
  5. package/api-docs/functions/applyContentHint.mdx +33 -0
  6. package/api-docs/functions/createAudioMixingProcess.mdx +20 -0
  7. package/api-docs/functions/createAudioStreamProcess.mdx +15 -0
  8. package/api-docs/functions/createGetDisplayMedia.mdx +26 -0
  9. package/api-docs/functions/createMedia.mdx +20 -0
  10. package/api-docs/functions/createMediaSignal.mdx +42 -0
  11. package/api-docs/functions/createMediaSignals.mdx +33 -0
  12. package/api-docs/functions/createPreviewStreamController.mdx +13 -0
  13. package/api-docs/functions/createVideoStreamProcess.mdx +13 -0
  14. package/api-docs/functions/deriveInitialPermissionStatus.mdx +14 -0
  15. package/api-docs/functions/getPermissionStatus.mdx +34 -0
  16. package/api-docs/functions/isAnalyzerNodeInitProp.mdx +13 -0
  17. package/api-docs/functions/isAudioContentHint.mdx +13 -0
  18. package/api-docs/functions/isMedia.mdx +13 -0
  19. package/api-docs/functions/isNonNullObject.mdx +13 -0
  20. package/api-docs/functions/isUserMediaStatus.mdx +13 -0
  21. package/api-docs/functions/isVideoContentHint.mdx +13 -0
  22. package/api-docs/functions/isVideoStreamTrackProcessorAPIs.mdx +13 -0
  23. package/api-docs/functions/setLogger.mdx +13 -0
  24. package/api-docs/functions/toDeniedDevices.mdx +13 -0
  25. package/api-docs/interfaces/AudioDetectionSignals.mdx +6 -0
  26. package/api-docs/interfaces/AudioSignalDetectionOptions.mdx +6 -0
  27. package/api-docs/interfaces/DenoiseParams.mdx +9 -0
  28. package/api-docs/interfaces/ExtendedMediaTrackSettings.mdx +38 -0
  29. package/api-docs/interfaces/Media.mdx +316 -0
  30. package/api-docs/interfaces/MediaAttributes.mdx +19 -0
  31. package/api-docs/interfaces/MediaChangesSignals.mdx +15 -0
  32. package/api-docs/interfaces/MediaController.mdx +11 -0
  33. package/api-docs/interfaces/MediaInit.mdx +14 -0
  34. package/api-docs/interfaces/MediaOptions.mdx +10 -0
  35. package/api-docs/interfaces/MediaProps.mdx +9 -0
  36. package/api-docs/interfaces/MediaSettings.mdx +6 -0
  37. package/api-docs/interfaces/MediaTrack.mdx +121 -0
  38. package/api-docs/interfaces/MediaTrackInit.mdx +29 -0
  39. package/api-docs/interfaces/PreviewControllerProps.mdx +14 -0
  40. package/api-docs/interfaces/PreviewEventHandler.mdx +19 -0
  41. package/api-docs/interfaces/PreviewStreamController.mdx +350 -0
  42. package/api-docs/interfaces/PreviewStreamParams.mdx +15 -0
  43. package/api-docs/interfaces/VoiceActivityDetectionOptions.mdx +6 -0
  44. package/api-docs/type-aliases/AudioContentHint.mdx +3 -0
  45. package/api-docs/type-aliases/CreatePreviewStreamController.mdx +3 -0
  46. package/api-docs/type-aliases/ExtendedMediaTrackSettingsKey.mdx +3 -0
  47. package/api-docs/type-aliases/GeneratedMediaSignals.mdx +9 -0
  48. package/api-docs/type-aliases/GetDisplayMedia.mdx +3 -0
  49. package/api-docs/type-aliases/GetUserMediaProcess.mdx +19 -0
  50. package/api-docs/type-aliases/MediaSignals.mdx +3 -0
  51. package/api-docs/type-aliases/MediaSignalsOptional.mdx +3 -0
  52. package/api-docs/type-aliases/MediaSignalsRequired.mdx +3 -0
  53. package/api-docs/type-aliases/PreviewInput.mdx +3 -0
  54. package/api-docs/type-aliases/Process.mdx +19 -0
  55. package/api-docs/type-aliases/Segmenters.mdx +3 -0
  56. package/api-docs/type-aliases/TrackProcessor.mdx +3 -0
  57. package/api-docs/type-aliases/Unsubscribe.mdx +7 -0
  58. package/api-docs/type-aliases/UserMediaValidator.mdx +13 -0
  59. package/api-docs/type-aliases/VideoContentHint.mdx +3 -0
  60. package/api-docs/type-aliases/VideoRenderParams.mdx +15 -0
  61. package/api-docs/type-aliases/VideoStreamTrackProcessorAPIs.mdx +7 -0
  62. package/api-docs/variables/AUDIO_CONTENT_HINTS.mdx +17 -0
  63. package/api-docs/variables/REQUIRED_SIGNAL_KEYS.mdx +3 -0
  64. package/api-docs/variables/VIDEO_CONTENT_HINTS.mdx +17 -0
  65. package/api-docs/variables/areBothGranted.mdx +3 -0
  66. package/api-docs/variables/hasNoAudioDevices.mdx +3 -0
  67. package/api-docs/variables/hasNoDevice.mdx +3 -0
  68. package/api-docs/variables/hasNoVideoDevices.mdx +3 -0
  69. package/api-docs/variables/internalSignals.mdx +13 -0
  70. package/api-docs/variables/isAudioDeviceInUse.mdx +3 -0
  71. package/api-docs/variables/isDeviceInUse.mdx +3 -0
  72. package/api-docs/variables/isDevicesInUse.mdx +3 -0
  73. package/api-docs/variables/isFallback.mdx +3 -0
  74. package/api-docs/variables/isFallbackAudio.mdx +3 -0
  75. package/api-docs/variables/isFallbackVideo.mdx +3 -0
  76. package/api-docs/variables/isGranted.mdx +3 -0
  77. package/api-docs/variables/isGrantedAudio.mdx +3 -0
  78. package/api-docs/variables/isGrantedOnlyAudio.mdx +3 -0
  79. package/api-docs/variables/isGrantedOnlyAudioNoVideoDevices.mdx +3 -0
  80. package/api-docs/variables/isGrantedOnlyVideo.mdx +3 -0
  81. package/api-docs/variables/isGrantedOnlyVideoNoAudioDevices.mdx +3 -0
  82. package/api-docs/variables/isGrantedVideo.mdx +3 -0
  83. package/api-docs/variables/isInitial.mdx +3 -0
  84. package/api-docs/variables/isInitialPermissions.mdx +3 -0
  85. package/api-docs/variables/isInitialPermissionsGranted.mdx +3 -0
  86. package/api-docs/variables/isInitialPermissionsNotGranted.mdx +3 -0
  87. package/api-docs/variables/isOnlyAudioError.mdx +3 -0
  88. package/api-docs/variables/isOnlyVideoError.mdx +3 -0
  89. package/api-docs/variables/isOverConstrained.mdx +3 -0
  90. package/api-docs/variables/isPromptAudio.mdx +3 -0
  91. package/api-docs/variables/isPromptVideo.mdx +3 -0
  92. package/api-docs/variables/isRejected.mdx +3 -0
  93. package/api-docs/variables/isRejectedOnlyAudio.mdx +3 -0
  94. package/api-docs/variables/isRejectedOnlyVideo.mdx +3 -0
  95. package/api-docs/variables/isRequestPermissionNeeded.mdx +3 -0
  96. package/api-docs/variables/isUnknownError.mdx +3 -0
  97. package/api-docs/variables/isVideoDeviceInUse.mdx +3 -0
  98. package/package.json +17 -12
@@ -0,0 +1,19 @@
1
+ ```ts
2
+ type Process<T> = (a) => Promise<MediaTrack>;
3
+ ```
4
+
5
+ ## Type Parameters
6
+
7
+ | Type Parameter |
8
+ | ------ |
9
+ | `T` |
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type |
14
+ | ------ | ------ |
15
+ | `a` | `T` |
16
+
17
+ ## Returns
18
+
19
+ `Promise`\<[`MediaTrack`](../interfaces/MediaTrack.mdx)\>
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type Segmenters = { [Property in SegmentationModel]: Segmenter };
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type TrackProcessor = Process<MediaTrack>;
3
+ ```
@@ -0,0 +1,7 @@
1
+ ```ts
2
+ type Unsubscribe = () => void;
3
+ ```
4
+
5
+ ## Returns
6
+
7
+ `void`
@@ -0,0 +1,13 @@
1
+ ```ts
2
+ type UserMediaValidator = (status) => boolean;
3
+ ```
4
+
5
+ ## Parameters
6
+
7
+ | Parameter | Type |
8
+ | ------ | ------ |
9
+ | `status` | [`UserMediaStatus`](../enumerations/UserMediaStatus.mdx) |
10
+
11
+ ## Returns
12
+
13
+ `boolean`
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type VideoContentHint = typeof VIDEO_CONTENT_HINTS[keyof typeof VIDEO_CONTENT_HINTS];
3
+ ```
@@ -0,0 +1,15 @@
1
+ ```ts
2
+ type VideoRenderParams = Omit<RendererOptions, "effects"> & object;
3
+ ```
4
+
5
+ ## Type Declaration
6
+
7
+ | Name | Type | Description |
8
+ | ------ | ------ | ------ |
9
+ | `frameRate` | `number` | Target frame rate for the video segmentation |
10
+ | `width` | `number` | Render Effects |
11
+ | `height` | `number` | - |
12
+ | `videoSegmentation` | `RenderEffects` | - |
13
+ | `pan?` | `boolean` | - |
14
+ | `tilt?` | `boolean` | - |
15
+ | `zoom?` | `boolean` | - |
@@ -0,0 +1,7 @@
1
+ ```ts
2
+ type VideoStreamTrackProcessorAPIs = "stream" | "canvas";
3
+ ```
4
+
5
+ Use which processor API to process the stream track
6
+ `stream` - Use `MediaStreamTrackProcessor`, when available
7
+ `canvas` - Use Canvas
@@ -0,0 +1,17 @@
1
+ ```ts
2
+ const AUDIO_CONTENT_HINTS: object;
3
+ ```
4
+
5
+ Audio content hints are only applicable when the MediaStreamTrack contains an
6
+ audio track
7
+
8
+ [https://www.w3.org/TR/mst-content-hint/#audio-content-hints](https://www.w3.org/TR/mst-content-hint/#audio-content-hints)
9
+
10
+ ## Type Declaration
11
+
12
+ | Name | Type | Default value | Description |
13
+ | ------ | ------ | ------ | ------ |
14
+ | <a id="nohint"></a> `NoHint` | `""` | `''` | No hint has been provided, the implementation should make its best-informed guess on how to handle contained audio data. This may be inferred from how the track was opened or by doing content analysis |
15
+ | <a id="speech"></a> `Speech` | `"speech"` | `'speech'` | The track should be treated as if it contains speech data. Consuming this signal it may be appropriate to apply noise suppression or boost intelligibility of the incoming signal. |
16
+ | <a id="speechrecognition"></a> `SpeechRecognition` | `"speech-recognition"` | `'speech-recognition'` | The track should be treated as if it contains data for the purpose of speech recognition by a machine. Consuming this signal it may be appropriate to boost intelligibility of the incoming signal for transcription and turn off audio-processing components that are used for human consumption. |
17
+ | <a id="music"></a> `Music` | `"music"` | `'music'` | The track should be treated as if it contains music data. Generally this might imply tuning or turning off audio-processing components that are used to process speech data to prevent the audio from being distorted. |
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const REQUIRED_SIGNAL_KEYS: readonly ["onMediaChanged", "onVAD", "onSilentDetected"];
3
+ ```
@@ -0,0 +1,17 @@
1
+ ```ts
2
+ const VIDEO_CONTENT_HINTS: object;
3
+ ```
4
+
5
+ Video content hints are only applicable when the MediaStreamTrack contains a
6
+ video track.
7
+
8
+ [https://www.w3.org/TR/mst-content-hint/#video-content-hints](https://www.w3.org/TR/mst-content-hint/#video-content-hints)
9
+
10
+ ## Type Declaration
11
+
12
+ | Name | Type | Default value | Description |
13
+ | ------ | ------ | ------ | ------ |
14
+ | <a id="nohint"></a> `NoHint` | `""` | `''` | No hint has been provided, the implementation should make its best-informed guess on how contained video content should be treated. This can for example be inferred from how the track was opened or by doing content analysis. |
15
+ | <a id="motion"></a> `Motion` | `"motion"` | `'motion'` | The track should be treated as if it contains video where motion is important. This is normally webcam video, movies or video games. Quantization artefacts and downscaling are acceptable in order to preserve motion as well as possible while still retaining target bitrates. During low bitrates when compromises have to be made, more effort is spent on preserving frame rate than edge quality and details. |
16
+ | <a id="detail"></a> `Detail` | `"detail"` | `'detail'` | The track should be treated as if video details are extra important. This is generally applicable to presentations or web pages with text content, painting or line art. This setting would normally optimize for detail in the resulting individual frames rather than smooth playback. Artefacts from quantization or downscaling that make small text or line art unintelligible should be avoided. |
17
+ | <a id="text"></a> `Text` | `"text"` | `'text'` | The track should be treated as if video details are extra important, and that significant sharp edges and areas of consistent color can occur frequently. This is generally applicable to presentations or web pages with text content. This setting would normally optimize for detail in the resulting individual frames rather than smooth playback, and may take advantage of encoder tools that optimize for text rendering. Artefacts from quantization or downscaling that make small text or line art unintelligible should be avoided. |
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const areBothGranted: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const hasNoAudioDevices: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const hasNoDevice: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const hasNoVideoDevices: UserMediaValidator;
3
+ ```
@@ -0,0 +1,13 @@
1
+ ```ts
2
+ const internalSignals: object;
3
+ ```
4
+
5
+ **`Internal`**
6
+
7
+ Internal signals
8
+
9
+ ## Type Declaration
10
+
11
+ | Name | Type |
12
+ | ------ | ------ |
13
+ | <a id="ondeviceschanged"></a> `onDevicesChanged` | `Signal`\<`IndexedDevices`, `IndexedDevices`\> |
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isAudioDeviceInUse: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isDeviceInUse: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isDevicesInUse: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isFallback: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isFallbackAudio: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isFallbackVideo: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isGranted: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isGrantedAudio: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isGrantedOnlyAudio: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isGrantedOnlyAudioNoVideoDevices: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isGrantedOnlyVideo: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isGrantedOnlyVideoNoAudioDevices: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isGrantedVideo: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isInitial: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isInitialPermissions: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isInitialPermissionsGranted: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isInitialPermissionsNotGranted: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isOnlyAudioError: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isOnlyVideoError: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isOverConstrained: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isPromptAudio: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isPromptVideo: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isRejected: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isRejectedOnlyAudio: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isRejectedOnlyVideo: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isRequestPermissionNeeded: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isUnknownError: UserMediaValidator;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const isVideoDeviceInUse: UserMediaValidator;
3
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pexip/media",
3
- "version": "20.3.4",
3
+ "version": "20.3.5",
4
4
  "description": "Home for media related stuff",
5
5
  "homepage": "https://gitlab.com/pexip/zoo",
6
6
  "bugs": "https://gitlab.com/pexip/zoo/issues",
@@ -26,37 +26,42 @@
26
26
  },
27
27
  "directories": {
28
28
  "lib": "lib",
29
- "test": "__tests__"
29
+ "test": "__tests__",
30
+ "doc": "api-docs"
30
31
  },
31
32
  "files": [
32
- "dist"
33
+ "dist",
34
+ "api-docs"
33
35
  ],
34
36
  "scripts": {
35
- "build": "pexip-bundler build",
36
- "build:sourcemap": "pexip-bundler build --sourcemap",
37
- "clean": "rm -fr dist",
37
+ "build": "pexip-bundler build && yarn docs",
38
+ "build:sourcemap": "pexip-bundler build --sourcemap && yarn docs",
39
+ "clean": "rm -fr dist api-docs",
38
40
  "dev": "pexip-bundler dev",
39
41
  "prepack": "yarn clean && yarn build",
40
42
  "test": "jest",
41
43
  "check-format": "prettier --ignore-path=../../.prettierignore --check .",
42
44
  "format": "prettier --ignore-path=../../.prettierignore --write .",
43
45
  "lint": "yarn run -T biome lint",
44
- "typecheck": "yarn tsc --noEmit -p ."
46
+ "typecheck": "yarn tsc --noEmit -p .",
47
+ "docs": "typedoc"
45
48
  },
46
49
  "dependencies": {
47
- "@pexip/media-control": "20.3.4",
48
- "@pexip/media-processor": "20.3.4",
49
- "@pexip/signal": "16.9.2",
50
- "@pexip/utils": "17.1.2"
50
+ "@pexip/media-control": "20.3.5",
51
+ "@pexip/media-processor": "20.3.5",
52
+ "@pexip/signal": "16.9.3",
53
+ "@pexip/utils": "17.1.3"
51
54
  },
52
55
  "devDependencies": {
53
56
  "@jest/globals": "^30.2.0",
54
- "@pexip/bundler": "18.1.2",
57
+ "@pexip/bundler": "18.2.0",
55
58
  "@swc/core": "^1.10.12",
56
59
  "@swc/jest": "^0.2.39",
57
60
  "jest": "^29.5.12",
58
61
  "jest-junit": "^16.0.0",
59
62
  "prettier": "^3.2.5",
63
+ "typedoc": "^0.28.15",
64
+ "typedoc-plugin-markdown": "^4.9.0",
60
65
  "typescript": "~5.7.3"
61
66
  },
62
67
  "publishConfig": {