File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " livekit-client " : patch
3+ ---
4+
5+ fix: skip default device selection on iOS
Original file line number Diff line number Diff line change @@ -1992,7 +1992,10 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
19921992 }
19931993 } ;
19941994
1995- private handleDeviceChange = async ( ) => {
1995+ /**
1996+ * attempt to select the default devices if the previously selected devices are no longer available after a device change event
1997+ */
1998+ private async selectDefaultDevices ( ) {
19961999 const previousDevices = DeviceManager . getInstance ( ) . previousDevices ;
19972000 // check for available devices, but don't request permissions in order to avoid prompts for kinds that haven't been used before
19982001 const availableDevices = await DeviceManager . getInstance ( ) . getDevices ( undefined , false ) ;
@@ -2055,7 +2058,13 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
20552058 await this . switchActiveDevice ( kind , devicesOfKind [ 0 ] . deviceId ) ;
20562059 }
20572060 }
2061+ }
20582062
2063+ private handleDeviceChange = async ( ) => {
2064+ if ( getBrowser ( ) ?. os !== 'iOS' ) {
2065+ // default devices are non deterministic on iOS, so we don't attempt to select them here
2066+ await this . selectDefaultDevices ( ) ;
2067+ }
20592068 this . emit ( RoomEvent . MediaDevicesChanged ) ;
20602069 } ;
20612070
You can’t perform that action at this time.
0 commit comments