feat(call): PTT, deafen label, camera default off, screenshare confirm, noise suppression setting
- Push to Talk: keydown/keyup binds mic to configurable key (default Space) with visual PTT indicator and key-binding UI in Settings > General > Calls - Camera always defaults OFF on join; cameraOnJoin setting for explicit opt-in - Deafen button tooltip corrected to Deafen/Undeafen instead of Turn Off/On Sound - Screenshare confirmation dialog before broadcasting to call participants - Noise suppression toggle wired from settings through CallEmbed URL params - CallControl.setMicrophone() public method for programmatic mic control - Calls settings section added to General settings page Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -28,10 +28,13 @@ export const makeCallPreferencesAtom = (userId: string): CallPreferencesAtom =>
|
||||
storeKey,
|
||||
(key) => {
|
||||
const v = getLocalStorageItem<CallPreferences>(key, DEFAULT_PREFERENCES);
|
||||
return v;
|
||||
// Never restore camera state — always start with camera off for privacy.
|
||||
// Users can toggle it in the prescreen before joining.
|
||||
return { ...v, video: false };
|
||||
},
|
||||
(key, value) => {
|
||||
setLocalStorageItem(key, value);
|
||||
// Don't persist video state — always resets to off on next load.
|
||||
setLocalStorageItem(key, { ...value, video: false });
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { createContext, useCallback, useContext } from 'react';
|
||||
import { useAtom } from 'jotai';
|
||||
import { CallPreferences, CallPreferencesAtom } from '../callPreferences';
|
||||
import { useSetting } from './settings';
|
||||
import { settingsAtom } from '../settings';
|
||||
|
||||
const CallPreferencesAtomContext = createContext<CallPreferencesAtom | null>(null);
|
||||
export const CallPreferencesProvider = CallPreferencesAtomContext.Provider;
|
||||
@@ -21,6 +23,7 @@ export const useCallPreferences = (): CallPreferences & {
|
||||
} => {
|
||||
const callPrefAtom = useCallPreferencesAtom();
|
||||
const [pref, setPref] = useAtom(callPrefAtom);
|
||||
const [cameraOnJoin] = useSetting(settingsAtom, 'cameraOnJoin');
|
||||
|
||||
const toggleMicrophone = useCallback(() => {
|
||||
const microphone = !pref.microphone;
|
||||
@@ -54,6 +57,7 @@ export const useCallPreferences = (): CallPreferences & {
|
||||
|
||||
return {
|
||||
...pref,
|
||||
video: cameraOnJoin ? pref.video : false,
|
||||
toggleMicrophone,
|
||||
toggleVideo,
|
||||
toggleSound,
|
||||
|
||||
@@ -46,6 +46,11 @@ export interface Settings {
|
||||
|
||||
chatBackground: ChatBackground;
|
||||
perMessageProfiles: boolean;
|
||||
|
||||
cameraOnJoin: boolean;
|
||||
callNoiseSuppression: boolean;
|
||||
pttMode: boolean;
|
||||
pttKey: string;
|
||||
}
|
||||
|
||||
const defaultSettings: Settings = {
|
||||
@@ -84,6 +89,11 @@ const defaultSettings: Settings = {
|
||||
|
||||
chatBackground: 'none',
|
||||
perMessageProfiles: false,
|
||||
|
||||
cameraOnJoin: false,
|
||||
callNoiseSuppression: true,
|
||||
pttMode: false,
|
||||
pttKey: 'Space',
|
||||
};
|
||||
|
||||
export const getSettings = () => {
|
||||
|
||||
Reference in New Issue
Block a user