Skip to content

Commit

Permalink
Fix permissions for all devices being requested when connecting/disco…
Browse files Browse the repository at this point in the history
…nnecting devices (#1249)
  • Loading branch information
lukasIO authored Sep 23, 2024
1 parent 57bf8ab commit c048bd8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wild-donkeys-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'livekit-client': patch
---

Fix permissions for all devices being requested when connecting/disconnecting devices
3 changes: 2 additions & 1 deletion src/room/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,8 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
};

private handleDeviceChange = async () => {
const availableDevices = await DeviceManager.getInstance().getDevices();
// check for available devices, but don't request permissions in order to avoid prompts for kinds that haven't been used before
const availableDevices = await DeviceManager.getInstance().getDevices(undefined, false);
// inputs are automatically handled via TrackEvent.Ended causing a TrackEvent.Restarted. Here we only need to worry about audiooutputs changing
const kinds: MediaDeviceKind[] = ['audiooutput'];
for (let kind of kinds) {
Expand Down

0 comments on commit c048bd8

Please sign in to comment.