mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-08 20:09:19 +00:00
Switch devices if the label doesn't match the default
This commit is contained in:
@@ -188,8 +188,9 @@ export function useLiveKit(
|
|||||||
// Plus, we need to avoid restarting again if the track is already in
|
// Plus, we need to avoid restarting again if the track is already in
|
||||||
// the process of being restarted.
|
// the process of being restarted.
|
||||||
activeMicTrack.mediaStreamTrack.readyState !== "ended" &&
|
activeMicTrack.mediaStreamTrack.readyState !== "ended" &&
|
||||||
defaultDevice.groupId !==
|
(defaultDevice.groupId !==
|
||||||
activeMicTrack.mediaStreamTrack.getSettings().groupId
|
activeMicTrack.mediaStreamTrack.getSettings().groupId ||
|
||||||
|
defaultDevice.label !== activeMicTrack.mediaStreamTrack.label)
|
||||||
) {
|
) {
|
||||||
// It's different, so restart the track, ie. cause Livekit to do another
|
// It's different, so restart the track, ie. cause Livekit to do another
|
||||||
// getUserMedia() call with deviceId: default to get the *new* default device.
|
// getUserMedia() call with deviceId: default to get the *new* default device.
|
||||||
|
|||||||
Reference in New Issue
Block a user