@pexip/media 20.0.1 → 20.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,19 @@
1
1
  # @pexip/media
2
2
 
3
+ ## 20.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3b30a30: Given recent changes in Chrome we will try to use `exact` constraints
8
+ if possible when acquiring a new stream and when applying changes from the
9
+ preview controller.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [30c0f81]
14
+ - @pexip/media-processor@20.1.0
15
+ - @pexip/media-control@20.1.0
16
+
3
17
  ## 20.0.1
4
18
 
5
19
  ### Patch Changes
@@ -297,10 +297,10 @@ export const createPreviewStreamController = ({ getCurrentDevices, getCurrentMed
297
297
  try {
298
298
  await replaceMainStream({
299
299
  audio: audioInput
300
- ? { device: audioInput, ...audioSettings }
300
+ ? { device: { exact: audioInput }, ...audioSettings }
301
301
  : false,
302
302
  video: videoInput
303
- ? { device: videoInput, ...videoSettings }
303
+ ? { device: { exact: videoInput }, ...videoSettings }
304
304
  : false,
305
305
  });
306
306
  props.originalMainAudioInput = props.audioInput;
package/dist/userMedia.js CHANGED
@@ -1,4 +1,4 @@
1
- import { MediaDeviceFailure, extractConstraintsWithKeys, findMediaInputFromMediaStreamTrack, getUserMedia, isExactDeviceConstraint, isStreamingRequestedDevices, } from '@pexip/media-control';
1
+ import { MediaDeviceFailure, extractConstraintsWithKeys, findMediaInputFromMediaStreamTrack, getUserMedia, isExactDeviceConstraint, isStreamingRequestedDevices, relaxInputConstraint, } from '@pexip/media-control';
2
2
  import { assert } from '@pexip/utils';
3
3
  import { UserMediaStatus } from './types';
4
4
  import { makeDeriveDeviceStatus, buildMedia, createMediaTrack, findExpectedInput, } from './utils';
@@ -515,7 +515,14 @@ export const createGetUserMediaProcess = ({ getUserMedia, getCurrentDevices, sig
515
515
  tracks: [],
516
516
  }));
517
517
  }
518
- const [stream, status] = await getUserMedia(constraints);
518
+ const relaxedConstraints = {};
519
+ if (constraints.audio) {
520
+ relaxedConstraints.audio = relaxInputConstraint('audioinput', constraints.audio, currentDevices);
521
+ }
522
+ if (constraints.video) {
523
+ relaxedConstraints.video = relaxInputConstraint('videoinput', constraints.video, currentDevices);
524
+ }
525
+ const [stream, status] = await getUserMedia(relaxedConstraints);
519
526
  let finalStatus = status;
520
527
  if (currentMedia &&
521
528
  constraints.audio !== false &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pexip/media",
3
- "version": "20.0.1",
3
+ "version": "20.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",
@@ -44,8 +44,8 @@
44
44
  "typecheck": "yarn tsc --noEmit -p ."
45
45
  },
46
46
  "dependencies": {
47
- "@pexip/media-control": "20.0.1",
48
- "@pexip/media-processor": "20.0.1",
47
+ "@pexip/media-control": "20.1.0",
48
+ "@pexip/media-processor": "20.1.0",
49
49
  "@pexip/signal": "16.8.0",
50
50
  "@pexip/utils": "17.0.0"
51
51
  },