@pexip/media 16.7.1 → 17.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @pexip/media
2
2
 
3
+ ## 17.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 4298b039: Allow setting default constraints to `false` Fix Audio mixing
8
+ processor to return immediately when no main tracks
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies [4298b039]
13
+ - Updated dependencies [9fa7884d]
14
+ - @pexip/media-control@17.1.0
15
+ - @pexip/utils@16.7.0
16
+ - @pexip/media-processor@17.1.0
17
+
18
+ ## 17.0.0
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [af71598]
23
+ - Updated dependencies [32c24c8d06]
24
+ - Updated dependencies [1f5d1df]
25
+ - @pexip/media-processor@17.0.0
26
+ - @pexip/media-control@17.0.0
27
+ - @pexip/signal@16.5.0
28
+ - @pexip/utils@16.6.0
29
+
3
30
  ## 16.7.1
4
31
 
5
32
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -369,8 +369,8 @@ interface MediaOptions {
369
369
  * Pass default constraints to use with get media wrappers
370
370
  */
371
371
  getDefaultConstraints?: () => {
372
- audio?: InputConstraintSet;
373
- video?: InputConstraintSet;
372
+ audio?: InputConstraintSet | false;
373
+ video?: InputConstraintSet | false;
374
374
  };
375
375
  }
376
376
  interface MediaProps {
package/dist/index.mjs CHANGED
@@ -1825,7 +1825,7 @@ var createAudioMixingProcess = (getCurrrentMedia, scope = "mixer") => {
1825
1825
  }
1826
1826
  return Promise.resolve();
1827
1827
  });
1828
- if (!media.stream) {
1828
+ if (!media.stream || !mainTrack && !displayTrack) {
1829
1829
  return media;
1830
1830
  }
1831
1831
  if (!mainTrack && displayTrack) {
@@ -2148,16 +2148,18 @@ var createMedia = ({
2148
2148
  });
2149
2149
  }
2150
2150
  };
2151
- const mergeMediaConstraints = (constraints) => ({
2152
- audio: mergeConstraints(getDefaultConstraints().audio)(
2153
- constraints.audio
2154
- ),
2155
- video: mergeConstraints(getDefaultConstraints().video)(
2156
- constraints.video
2157
- )
2158
- });
2151
+ const mergeMediaConstraints = (constraints) => {
2152
+ const { audio, video } = getDefaultConstraints();
2153
+ return {
2154
+ audio: audio === false ? false : mergeConstraints(audio)(constraints.audio),
2155
+ video: video === false ? false : mergeConstraints(video)(constraints.video)
2156
+ };
2157
+ };
2159
2158
  const getUserMediaAsync = async (constraints) => {
2160
- queue.enqueue(async () => await updateMedia(constraints), false);
2159
+ queue.enqueue(
2160
+ async () => await updateMedia(mergeMediaConstraints(constraints)),
2161
+ false
2162
+ );
2161
2163
  await queue.execute();
2162
2164
  };
2163
2165
  const getUserMedia3 = (constraints) => {
@@ -2172,11 +2174,14 @@ var createMedia = ({
2172
2174
  { status: props.media.status },
2173
2175
  "Current Permission State"
2174
2176
  );
2177
+ const mergedConstraints = mergeMediaConstraints(constraints);
2178
+ props.media.constraints = mergedConstraints;
2175
2179
  props.devices = await getDevices2();
2180
+ if (!mergedConstraints.audio && !mergedConstraints.video) {
2181
+ return;
2182
+ }
2176
2183
  if (isInitialPermissionsGranted(props.media.status)) {
2177
- return await updateMedia(
2178
- mergeMediaConstraints(constraints)
2179
- );
2184
+ return await updateMedia(mergedConstraints);
2180
2185
  }
2181
2186
  });
2182
2187
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pexip/media",
3
- "version": "16.7.1",
3
+ "version": "17.1.0",
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",
@@ -32,19 +32,19 @@
32
32
  "typecheck": "yarn tsc --noEmit -p ."
33
33
  },
34
34
  "dependencies": {
35
- "@pexip/media-control": "16.7.1",
36
- "@pexip/media-processor": "16.7.1",
35
+ "@pexip/media-control": "17.1.0",
36
+ "@pexip/media-processor": "17.1.0",
37
37
  "@pexip/signal": "16.5.0",
38
- "@pexip/utils": "16.6.0"
38
+ "@pexip/utils": "16.7.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@jest/globals": "^29.5.0",
42
- "@pexip/bundler": "16.3.0",
42
+ "@pexip/bundler": "16.4.0",
43
43
  "prettier": "^2.7.1",
44
44
  "typescript": "~5.0.0"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public",
48
- "registry": "https://registry.npmjs.org"
48
+ "registry": "https://registry.npmjs.org/"
49
49
  }
50
50
  }