(feat): add deaf & mute button

(feat): add ping graph (via recharts)
(feat): remove old expand button
This commit is contained in:
Alois 2026-04-28 22:44:56 +02:00
commit d01df7c02c
6 changed files with 212 additions and 53 deletions

View file

@ -116,6 +116,17 @@ export default function Provider(props: { children: React.ReactNode }) {
typeof ttp.call_data.response
> | null>(null);
const [deaf, setDeaf] = useState(false);
const toggleDeaf = () => {
setDeaf((wasDeaf) => {
room.remoteParticipants.forEach((participant) => {
participant.setVolume(wasDeaf ? 100 : 0);
});
return !wasDeaf;
});
};
const openCallPage = (callId: string) =>
navigate({ to: "/call", search: { id: callId } });
@ -166,6 +177,9 @@ export default function Provider(props: { children: React.ReactNode }) {
callId,
openCallPage,
deaf,
toggleDeaf,
disconnect,
joinCall,
currentCallData,
@ -252,6 +266,8 @@ type contextType = {
room: Room;
openCallPage: (callId: string) => Promise<void>;
callId: string | null;
deaf: boolean;
toggleDeaf: () => void;
};
export function useCall(): contextType {