chore: Fix app
This commit is contained in:
@@ -91,6 +91,8 @@ export class DirectCallService {
|
||||
&& this.hasConnectedParticipant(session)) ?? null;
|
||||
});
|
||||
readonly currentSession = signal<DirectCallSession | null>(null);
|
||||
/** User-facing reason the last joinCall attempt failed; null after a successful join. */
|
||||
readonly joinError = signal<string | null>(null);
|
||||
readonly hasActiveCall = computed(() => this.visibleActiveSessions().length > 0);
|
||||
readonly mobileOverlaySession = computed(() => {
|
||||
const callId = this.mobileOverlayCallId();
|
||||
@@ -333,6 +335,7 @@ export class DirectCallService {
|
||||
return;
|
||||
}
|
||||
|
||||
this.joinError.set(null);
|
||||
this.leaveOtherJoinedCalls(callId);
|
||||
this.leaveCurrentVoiceTargetForCall(callId);
|
||||
this.audio.stop(AppSound.Call);
|
||||
@@ -344,22 +347,36 @@ export class DirectCallService {
|
||||
|
||||
const ok = await this.voice.ensureSignalingConnected();
|
||||
|
||||
if (!ok || !navigator.mediaDevices?.getUserMedia) {
|
||||
if (!ok) {
|
||||
this.joinError.set(this.i18n.instant('call.errors.signalingUnavailable'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!navigator.mediaDevices?.getUserMedia) {
|
||||
this.joinError.set(this.i18n.instant('call.errors.captureUnsupported'));
|
||||
return;
|
||||
}
|
||||
|
||||
const voicePermissionsGranted = await this.mobileMedia.ensureVoiceCapturePermissions();
|
||||
|
||||
if (!voicePermissionsGranted) {
|
||||
this.joinError.set(this.i18n.instant('call.errors.microphonePermissionDenied'));
|
||||
return;
|
||||
}
|
||||
|
||||
const stream = await navigator.mediaDevices.getUserMedia({
|
||||
audio: {
|
||||
echoCancellation: true,
|
||||
noiseSuppression: false
|
||||
}
|
||||
});
|
||||
let stream: MediaStream;
|
||||
|
||||
try {
|
||||
stream = await navigator.mediaDevices.getUserMedia({
|
||||
audio: {
|
||||
echoCancellation: true,
|
||||
noiseSuppression: false
|
||||
}
|
||||
});
|
||||
} catch {
|
||||
this.joinError.set(this.i18n.instant('call.errors.microphoneUnavailable'));
|
||||
return;
|
||||
}
|
||||
|
||||
await this.voice.setLocalStream(stream);
|
||||
this.voiceActivity.trackLocalMic(meId, stream);
|
||||
|
||||
Reference in New Issue
Block a user