@fishjam-cloud/react-client 0.16.0 → 0.16.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"useMediaDevices.d.ts","sourceRoot":"","sources":["../../../../src/hooks/internal/devices/useMediaDevices.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAG7G,UAAU,eAAe;IACvB,gBAAgB,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC;IACnD,gBAAgB,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC;IACnD,eAAe,CAAC,EAAE,yBAAyB,CAAC;CAC7C;AAED,MAAM,MAAM,yBAAyB,GAAG;IAAE,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzF,eAAO,MAAM,eAAe,GAAI,yDAAyD,eAAe;mCAmClF,yBAAyB,KAAG,OAAO,CAAC,uBAAuB,CAAC;;;CA0GjF,CAAC"}
1
+ {"version":3,"file":"useMediaDevices.d.ts","sourceRoot":"","sources":["../../../../src/hooks/internal/devices/useMediaDevices.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAG7G,UAAU,eAAe;IACvB,gBAAgB,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC;IACnD,gBAAgB,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC;IACnD,eAAe,CAAC,EAAE,yBAAyB,CAAC;CAC7C;AAED,MAAM,MAAM,yBAAyB,GAAG;IAAE,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzF,eAAO,MAAM,eAAe,GAAI,yDAAyD,eAAe;mCAmClF,yBAAyB,KAAG,OAAO,CAAC,uBAAuB,CAAC;;;CAyGjF,CAAC"}
@@ -33,14 +33,16 @@ export const useMediaDevices = ({ videoConstraints, audioConstraints, persistHan
33
33
  };
34
34
  const intitialize = async () => {
35
35
  let media = await getAvailableMedia(constraints);
36
- const devices = await navigator.mediaDevices.enumerateDevices();
37
- setDeviceList(devices);
36
+ const fetchedDevices = await navigator.mediaDevices.enumerateDevices();
37
+ setDeviceList(fetchedDevices);
38
38
  if (media.stream) {
39
- media = await correctDevicesOnSafari(media.stream, media.errors, devices, constraints, lastUsed);
39
+ media = await correctDevicesOnSafari(media.stream, media.errors, fetchedDevices, constraints, lastUsed);
40
40
  }
41
41
  const { stream, errors } = media;
42
- const videoDevice = deviceList.find((device) => device.deviceId === stream?.getVideoTracks()[0].getSettings().deviceId);
43
- const audioDevice = deviceList.find((device) => device.deviceId === stream?.getAudioTracks()[0].getSettings().deviceId);
42
+ const videoDeviceId = stream?.getVideoTracks()[0].getSettings().deviceId;
43
+ const audioDeviceId = stream?.getAudioTracks()[0].getSettings().deviceId;
44
+ const videoDevice = fetchedDevices.find((device) => device.deviceId === videoDeviceId);
45
+ const audioDevice = fetchedDevices.find((device) => device.deviceId === audioDeviceId);
44
46
  if (videoDevice) {
45
47
  selectCamera(videoDevice);
46
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishjam-cloud/react-client",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "description": "React client library for Fishjam",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Fishjam Team",
@@ -60,7 +60,7 @@
60
60
  "vitest": "^3.1.1"
61
61
  },
62
62
  "dependencies": {
63
- "@fishjam-cloud/ts-client": "0.16.0",
63
+ "@fishjam-cloud/ts-client": "0.16.1",
64
64
  "events": "3.3.0",
65
65
  "lodash.isequal": "4.5.0"
66
66
  },