mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-08 20:09:19 +00:00
dont restart audio track on ios
Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -47,6 +47,7 @@ import { useUrlParams } from "../UrlParams";
|
|||||||
import { useInitial } from "../useInitial";
|
import { useInitial } from "../useInitial";
|
||||||
import { getValue } from "../utils/observable";
|
import { getValue } from "../utils/observable";
|
||||||
import { type SelectedDevice } from "../state/MediaDevices";
|
import { type SelectedDevice } from "../state/MediaDevices";
|
||||||
|
import { platform } from "../Platform";
|
||||||
|
|
||||||
interface UseLivekitResult {
|
interface UseLivekitResult {
|
||||||
livekitRoom?: Room;
|
livekitRoom?: Room;
|
||||||
@@ -331,6 +332,7 @@ export function useLivekit(
|
|||||||
): Subscription =>
|
): Subscription =>
|
||||||
selected$.subscribe((device) => {
|
selected$.subscribe((device) => {
|
||||||
if (
|
if (
|
||||||
|
// !(kind === "audioinput" && platform === "ios") &&
|
||||||
device !== undefined &&
|
device !== undefined &&
|
||||||
room.getActiveDevice(kind) !== device.id
|
room.getActiveDevice(kind) !== device.id
|
||||||
) {
|
) {
|
||||||
@@ -357,6 +359,9 @@ export function useLivekit(
|
|||||||
devices.audioInput.selected$
|
devices.audioInput.selected$
|
||||||
.pipe(switchMap((device) => device?.hardwareDeviceChange$ ?? NEVER))
|
.pipe(switchMap((device) => device?.hardwareDeviceChange$ ?? NEVER))
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
|
if (platform === "ios") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const activeMicTrack = Array.from(
|
const activeMicTrack = Array.from(
|
||||||
room.localParticipant.audioTrackPublications.values(),
|
room.localParticipant.audioTrackPublications.values(),
|
||||||
).find((d) => d.source === Track.Source.Microphone)?.track;
|
).find((d) => d.source === Track.Source.Microphone)?.track;
|
||||||
|
|||||||
Reference in New Issue
Block a user