@pexip/media 20.0.0 → 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,30 @@
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
+
17
+ ## 20.0.1
18
+
19
+ ### Patch Changes
20
+
21
+ - 091652a: emit `onAudioMuteStateChanged` and `onVideoMuteStateChanged` each
22
+ time we call `syncMuteState`
23
+ - @pexip/media-control@20.0.1
24
+ - @pexip/media-processor@20.0.1
25
+ - @pexip/signal@16.8.0
26
+ - @pexip/utils@17.0.0
27
+
3
28
  ## 20.0.0
4
29
 
5
30
  ### Major Changes
package/dist/media.js CHANGED
@@ -266,20 +266,19 @@ export const createMedia = ({ getMuteState, signals, audioProcessors, videoProce
266
266
  const syncMuteState = (tracks) => {
267
267
  const inputMuted = getMuteState();
268
268
  for (const track of tracks) {
269
- const prevMuted = track.muted;
270
269
  switch (track.kind) {
271
270
  case 'audioinput': {
272
271
  track.mute(inputMuted.audio);
273
- if (prevMuted !== track.muted) {
274
- signals.onAudioMuteStateChanged?.emit(track.muted);
275
- }
272
+ // FIXME: this can fire too often, but we want to make sure we signal initial state as well.
273
+ // We should only fire this when needed.
274
+ signals.onAudioMuteStateChanged?.emit(track.muted);
276
275
  break;
277
276
  }
278
277
  case 'videoinput':
279
278
  track.mute(inputMuted.video);
280
- if (prevMuted !== track.muted) {
281
- signals.onVideoMuteStateChanged?.emit(track.muted);
282
- }
279
+ // FIXME: this can fire too often, but we want to make sure we signal initial state as well.
280
+ // We should only fire this when needed.
281
+ signals.onVideoMuteStateChanged?.emit(track.muted);
283
282
  break;
284
283
  default:
285
284
  break;
@@ -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.0",
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,14 +44,14 @@
44
44
  "typecheck": "yarn tsc --noEmit -p ."
45
45
  },
46
46
  "dependencies": {
47
- "@pexip/media-control": "20.0.0",
48
- "@pexip/media-processor": "20.0.0",
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
  },
52
52
  "devDependencies": {
53
53
  "@jest/globals": "^29.7.0",
54
- "@pexip/bundler": "18.0.0",
54
+ "@pexip/bundler": "18.1.0",
55
55
  "@swc/core": "^1.10.12",
56
56
  "@swc/jest": "^0.2.37",
57
57
  "jest": "^29.5.12",