This commit is contained in:
7w1 committed 2026-05-14 19:30:49 -05:00
1 parent f35cfad3f0
commit 329520a80e
6 files changed
+38 -18

No files matched your search

+1 -1
View File
@@ -212,7 +212,7 @@ export function IncomingCallInternal({ room, incomingCall, onClose }: IncomingCa
if (evt.key === 'Escape') {
evt.preventDefault();
evt.stopPropagation();
void handleDeclineOrIgnore();
handleDeclineOrIgnore();
return;
}
if (evt.key === 'Enter' && canAnswer) {
+11 -3
View File
@@ -183,6 +183,12 @@ export function CallView({ resizable }: CallViewProps) {
const room = useRoom();
const screenSize = useScreenSizeContext();
const isMobile = screenSize === ScreenSize.Mobile;
const desktopMinCallHeight = 620;
const desktopMaxCallHeight = Math.round(window.innerHeight * 0.8);
const desktopDefaultCallHeight = Math.min(
Math.max(desktopMinCallHeight, Math.round(window.innerHeight * 0.72)),
desktopMaxCallHeight
);
const callViewRef = useRef<HTMLDivElement>(null);
const callContainerRef = useRef<HTMLDivElement>(null);
@@ -193,7 +199,7 @@ export function CallView({ resizable }: CallViewProps) {
const currentJoined = callEmbed?.roomId === room.roomId && callJoined;
const [height, setHeight] = useState(isMobile ? 240 : 380);
const [height, setHeight] = useState(isMobile ? 240 : desktopDefaultCallHeight);
const [isDragging, setIsDragging] = useState(false);
const isResizing = useRef(false);
const previousBodyUserSelect = useRef<string | null>(null);
@@ -202,9 +208,11 @@ export function CallView({ resizable }: CallViewProps) {
(clientY: number) => {
if (!isResizing.current || !callViewRef.current) return;
const { top } = callViewRef.current.getBoundingClientRect();
setHeight(Math.max(isMobile ? 120 : 150, Math.min(clientY - top, window.innerHeight * 0.8)));
const maxHeight = window.innerHeight * 0.8;
const minHeight = isMobile ? 120 : Math.min(desktopMinCallHeight, maxHeight);
setHeight(Math.max(minHeight, Math.min(clientY - top, maxHeight)));
},
[isMobile]
[isMobile, desktopMinCallHeight]
);
const handleMouseMove = useCallback((e: MouseEvent) => handleMove(e.clientY), [handleMove]);
+8 -4
View File
@@ -73,8 +73,10 @@ async function clearCustomCallAudio(key: string): Promise<void> {
});
}
export const putCustomCallRingtone = (file: File, durationMs: number): Promise<StoredCallRingtone> =>
putCustomCallAudio(CUSTOM_RINGTONE_KEY, file, durationMs);
export const putCustomCallRingtone = (
file: File,
durationMs: number
): Promise<StoredCallRingtone> => putCustomCallAudio(CUSTOM_RINGTONE_KEY, file, durationMs);
export const getCustomCallRingtone = (): Promise<StoredCallRingtone | undefined> =>
getCustomCallAudio(CUSTOM_RINGTONE_KEY);
@@ -82,8 +84,10 @@ export const getCustomCallRingtone = (): Promise<StoredCallRingtone | undefined>
export const clearCustomCallRingtone = (): Promise<void> =>
clearCustomCallAudio(CUSTOM_RINGTONE_KEY);
export const putCustomCallRingback = (file: File, durationMs: number): Promise<StoredCallRingtone> =>
putCustomCallAudio(CUSTOM_RINGBACK_KEY, file, durationMs);
export const putCustomCallRingback = (
file: File,
durationMs: number
): Promise<StoredCallRingtone> => putCustomCallAudio(CUSTOM_RINGBACK_KEY, file, durationMs);
export const getCustomCallRingback = (): Promise<StoredCallRingtone | undefined> =>
getCustomCallAudio(CUSTOM_RINGBACK_KEY);
+6 -5
View File
@@ -29,10 +29,7 @@ import {
resolveOutgoingRingbackToneUrl,
} from '$features/call/callRingtone';
import { dismissSystemCallNotifications } from '$features/call/callNotificationBridge';
import {
getCustomCallRingback,
getCustomCallRingtone,
} from '$features/call/callRingtoneStorage';
import { getCustomCallRingback, getCustomCallRingtone } from '$features/call/callRingtoneStorage';
import { useMatrixClient } from './useMatrixClient';
import { createDebugLogger } from '../utils/debugLogger';
@@ -473,7 +470,11 @@ export function useIncomingCallSignaling() {
}
const session = mx.matrixRTC.getRoomSession(outgoingRoom);
const pendingOutgoing = isOutgoingCallPending(myUserId, outgoingRoom, session.sessionDescription);
const pendingOutgoing = isOutgoingCallPending(
myUserId,
outgoingRoom,
session.sessionDescription
);
const activeCall = isCallActive(myUserId, outgoingRoom, session.sessionDescription);
if (!pendingOutgoing || activeCall) {
+9 -4
View File
@@ -166,7 +166,7 @@ export class CallControl extends EventEmitter implements CallControlState {
const callDocument = this.iframe.contentDocument ?? this.iframe.contentWindow?.document;
const shouldMute = this.outputOverrideMuted || !sound;
if (callDocument) {
callDocument.querySelectorAll('audio, video').forEach((el) => {
callDocument.querySelectorAll<HTMLMediaElement>('audio, video').forEach((el) => {
el.muted = shouldMute;
if (shouldMute) el.volume = 0;
});
@@ -188,7 +188,12 @@ export class CallControl extends EventEmitter implements CallControlState {
const originalCtor = scopedWindow[key];
if (typeof originalCtor !== 'function') return;
const originalResume = originalCtor.prototype.resume;
const resumeDescriptor = Object.getOwnPropertyDescriptor(originalCtor.prototype, 'resume');
const originalResumeImpl = resumeDescriptor?.value as
| ((this: AudioContext) => Promise<void>)
| undefined;
if (typeof originalResumeImpl !== 'function') return;
const originalResume = (context: AudioContext): Promise<void> => originalResumeImpl.call(context);
const trackedContexts = this.trackedAudioContexts;
const isOverrideMuted = () => this.outputOverrideMuted;
originalCtor.prototype.resume = function patchedResume(this: AudioContext) {
@@ -196,10 +201,10 @@ export class CallControl extends EventEmitter implements CallControlState {
if (isOverrideMuted()) {
return Promise.resolve();
}
return originalResume.call(this);
return originalResume(this);
};
this.audioPatchRestores.push(() => {
originalCtor.prototype.resume = originalResume;
originalCtor.prototype.resume = originalResumeImpl;
});
const wrappedCtor = function patchedAudioContext(
+3 -1
View File
@@ -720,9 +720,11 @@ self.addEventListener('fetch', (event: FetchEvent) => {
if (method !== 'GET') return;
if (isElementCallRingtoneRequest(url)) {
const silentWavBytes = createSilentWavBytes();
const silentWavBuffer = new Uint8Array(silentWavBytes).buffer;
event.respondWith(
Promise.resolve(
new Response(createSilentWavBytes(), {
new Response(silentWavBuffer, {
status: 200,
headers: {
'Content-Type': 'audio/wav',