@poolse/react 2.14.0 → 2.14.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.
package/dist/index.d.cts CHANGED
@@ -532,6 +532,17 @@ interface UseCallRoom {
532
532
  activeDevices: Partial<Record<CallDeviceKind, string>>;
533
533
  /** Move the call onto another camera, microphone or output. */
534
534
  selectDevice: (kind: CallDeviceKind, deviceId: string) => Promise<void>;
535
+ /**
536
+ * Re-read the device list.
537
+ *
538
+ * Called for you on connect and whenever devices change, so this is
539
+ * for the case neither covers: a browser only reveals device ids and
540
+ * labels once the page holds a matching permission, and the moment
541
+ * that permission lands is not an event you can subscribe to. Call it
542
+ * when opening a picker and the list will be right by the time it is
543
+ * on screen.
544
+ */
545
+ refreshDevices: () => void;
535
546
  /**
536
547
  * Everyone else has gone and is not coming back.
537
548
  *
package/dist/index.d.ts CHANGED
@@ -532,6 +532,17 @@ interface UseCallRoom {
532
532
  activeDevices: Partial<Record<CallDeviceKind, string>>;
533
533
  /** Move the call onto another camera, microphone or output. */
534
534
  selectDevice: (kind: CallDeviceKind, deviceId: string) => Promise<void>;
535
+ /**
536
+ * Re-read the device list.
537
+ *
538
+ * Called for you on connect and whenever devices change, so this is
539
+ * for the case neither covers: a browser only reveals device ids and
540
+ * labels once the page holds a matching permission, and the moment
541
+ * that permission lands is not an event you can subscribe to. Call it
542
+ * when opening a picker and the list will be right by the time it is
543
+ * on screen.
544
+ */
545
+ refreshDevices: () => void;
535
546
  /**
536
547
  * Everyone else has gone and is not coming back.
537
548
  *
package/dist/index.js CHANGED
@@ -1191,6 +1191,9 @@ function useCallRoom(conversationId, opts) {
1191
1191
  await room.switchCamera();
1192
1192
  setFacing(room.getFacingMode());
1193
1193
  }, [room]);
1194
+ const refresh = useCallback(() => {
1195
+ if (room) refreshDevices(room);
1196
+ }, [room, refreshDevices]);
1194
1197
  const selectDevice = useCallback(
1195
1198
  async (kind, deviceId) => {
1196
1199
  if (!room) return;
@@ -1211,6 +1214,7 @@ function useCallRoom(conversationId, opts) {
1211
1214
  alone,
1212
1215
  devices,
1213
1216
  activeDevices,
1217
+ refreshDevices: refresh,
1214
1218
  error,
1215
1219
  sfuAvailable,
1216
1220
  join,