mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-29 21:15:19 +00:00
use "" instead of undefined for audio output default and on syncDevice + logging
Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -117,7 +117,7 @@ export function useLivekit(
|
|||||||
// deviceId here, because it will be set by the native app.
|
// deviceId here, because it will be set by the native app.
|
||||||
// (also the id does not need to match a browser device id)
|
// (also the id does not need to match a browser device id)
|
||||||
deviceId: controlledAudioDevices
|
deviceId: controlledAudioDevices
|
||||||
? undefined
|
? ""
|
||||||
: getValue(devices.audioOutput.selected$)?.id,
|
: getValue(devices.audioOutput.selected$)?.id,
|
||||||
},
|
},
|
||||||
e2ee,
|
e2ee,
|
||||||
@@ -333,13 +333,23 @@ export function useLivekit(
|
|||||||
selected$: Observable<SelectedDevice | undefined>,
|
selected$: Observable<SelectedDevice | undefined>,
|
||||||
): Subscription =>
|
): Subscription =>
|
||||||
selected$.subscribe((device) => {
|
selected$.subscribe((device) => {
|
||||||
|
let d = device;
|
||||||
|
if (controlledAudioDevices && kind === "audiooutput") {
|
||||||
|
d = { id: "" };
|
||||||
|
}
|
||||||
|
logger.info(
|
||||||
|
"[LivekitRoom] syncDevice room.getActiveDevice(kind) !== d.id :",
|
||||||
|
room.getActiveDevice(kind),
|
||||||
|
" !== ",
|
||||||
|
d?.id,
|
||||||
|
);
|
||||||
if (
|
if (
|
||||||
!(kind === "audioinput" && platform === "ios") &&
|
!(kind === "audioinput" && platform === "ios") &&
|
||||||
device !== undefined &&
|
d !== undefined &&
|
||||||
room.getActiveDevice(kind) !== device.id
|
room.getActiveDevice(kind) !== d.id
|
||||||
) {
|
) {
|
||||||
room
|
room
|
||||||
.switchActiveDevice(kind, device.id)
|
.switchActiveDevice(kind, d.id)
|
||||||
.catch((e) =>
|
.catch((e) =>
|
||||||
logger.error(`Failed to sync ${kind} device with LiveKit`, e),
|
logger.error(`Failed to sync ${kind} device with LiveKit`, e),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user