mirror of
https://github.com/vector-im/element-call.git
synced 2026-03-19 06:20:25 +00:00
controlled with syncing but no output syncing
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.
|
||||
// (also the id does not need to match a browser device id)
|
||||
deviceId: controlledAudioDevices
|
||||
? "default"
|
||||
? undefined
|
||||
: getValue(devices.audioOutput.selected$)?.id,
|
||||
},
|
||||
e2ee,
|
||||
@@ -329,23 +329,23 @@ export function useLivekit(
|
||||
selected$: Observable<SelectedDevice | undefined>,
|
||||
): Subscription =>
|
||||
selected$.subscribe((device) => {
|
||||
let d = device;
|
||||
if (controlledAudioDevices && kind === "audiooutput") {
|
||||
d = { id: "default" };
|
||||
}
|
||||
// let d = device;
|
||||
// if (controlledAudioDevices && kind === "audiooutput") {
|
||||
// d = { id: "default" };
|
||||
// }
|
||||
logger.warn(
|
||||
"[LivekitRoom] syncDevice room.getActiveDevice(kind) !== d.id :",
|
||||
room.getActiveDevice(kind),
|
||||
" !== ",
|
||||
d?.id,
|
||||
device?.id,
|
||||
);
|
||||
if (
|
||||
!(kind === "audioinput" && platform === "ios") &&
|
||||
d !== undefined &&
|
||||
room.getActiveDevice(kind) !== d.id
|
||||
device !== undefined &&
|
||||
room.getActiveDevice(kind) !== device.id
|
||||
) {
|
||||
room
|
||||
.switchActiveDevice(kind, d.id)
|
||||
.switchActiveDevice(kind, device.id)
|
||||
.catch((e) =>
|
||||
logger.error(`Failed to sync ${kind} device with LiveKit`, e),
|
||||
);
|
||||
@@ -354,7 +354,9 @@ export function useLivekit(
|
||||
|
||||
const subscriptions = [
|
||||
syncDevice("audioinput", devices.audioInput.selected$),
|
||||
syncDevice("audiooutput", devices.audioOutput.selected$),
|
||||
!controlledAudioDevices
|
||||
? syncDevice("audiooutput", devices.audioOutput.selected$)
|
||||
: undefined,
|
||||
syncDevice("videoinput", devices.videoInput.selected$),
|
||||
// Restart the audio input track whenever we detect that the active media
|
||||
// device has changed to refer to a different hardware device. We do this
|
||||
@@ -397,7 +399,7 @@ export function useLivekit(
|
||||
];
|
||||
|
||||
return (): void => {
|
||||
for (const s of subscriptions) s.unsubscribe();
|
||||
for (const s of subscriptions) s?.unsubscribe();
|
||||
};
|
||||
}
|
||||
}, [room, devices, connectionState, controlledAudioDevices]);
|
||||
|
||||
@@ -392,10 +392,9 @@ export class MediaDevices {
|
||||
public readonly audioOutput: MediaDevice<
|
||||
AudioOutputDeviceLabel,
|
||||
SelectedAudioOutputDevice
|
||||
> =
|
||||
// getUrlParams().controlledAudioDevices
|
||||
// ? new ControlledAudioOutput(this.scope):
|
||||
new AudioOutput(this.usingNames$, this.scope);
|
||||
> = getUrlParams().controlledAudioDevices
|
||||
? new ControlledAudioOutput(this.scope)
|
||||
: new AudioOutput(this.usingNames$, this.scope);
|
||||
|
||||
public readonly videoInput: MediaDevice<DeviceLabel, SelectedDevice> =
|
||||
new VideoInput(this.usingNames$, this.scope);
|
||||
|
||||
Reference in New Issue
Block a user