diff --git a/packages/web/src/hooks/useLiveKit.ts b/packages/web/src/hooks/useLiveKit.ts index b01e319d..bc6f403a 100644 --- a/packages/web/src/hooks/useLiveKit.ts +++ b/packages/web/src/hooks/useLiveKit.ts @@ -30,6 +30,7 @@ import { resolveNativeOverdrive, } from '../utils/screenShare'; import { getMediaStreamTrack } from '../utils/livekitInternals'; +import { deactivate as deactivateHwOverdrive } from '../utils/hwOverdrive'; let _activeRoom: Room | null = null; let _publishedScreenShareCodec: 'vp9' | 'h264' | null = null; @@ -560,6 +561,7 @@ export function useLiveKit() { const disconnect = useCallback(async () => { _connectGeneration++; SpeakingDetector.getInstance().clear(); + deactivateHwOverdrive(); connectedChannelRef.current = null; setConnectedChannelId(null); if (roomRef.current) { @@ -650,7 +652,7 @@ export function useLiveKit() { }, [room, screenShareConfig, isScreenSharing, isCameraOn, hwOverdrive]); useEffect(() => { - return () => { _connectGeneration++; SpeakingDetector.getInstance().clear(); if (roomRef.current) { destroyRoom(roomRef.current); roomRef.current = null; _activeRoom = null; } }; + return () => { _connectGeneration++; SpeakingDetector.getInstance().clear(); deactivateHwOverdrive(); if (roomRef.current) { destroyRoom(roomRef.current); roomRef.current = null; _activeRoom = null; } }; }, []); diff --git a/packages/web/src/stores/voiceStore.ts b/packages/web/src/stores/voiceStore.ts index d0c38c7b..9cad5511 100644 --- a/packages/web/src/stores/voiceStore.ts +++ b/packages/web/src/stores/voiceStore.ts @@ -401,6 +401,7 @@ export const useVoiceStore = create()( resetSession: () => set({ // Connection state + hwOverdrive: false, voiceUsers: new Map(), voiceUserStates: new Map(), currentVoiceChannelId: null, @@ -459,6 +460,7 @@ export const useVoiceStore = create()( return { currentVoiceChannelId: null, + hwOverdrive: false, isCameraOn: false, isScreenSharing: false, participants: [], @@ -493,6 +495,7 @@ export const useVoiceStore = create()( handleForceDisconnect: () => { set({ currentVoiceChannelId: null, + hwOverdrive: false, isCameraOn: false, isScreenSharing: false, participants: [],