fix: PTT blur/unmute, EC button hiding robustness, PTT status indicator
This commit is contained in:
@@ -5,6 +5,8 @@ import { StatusDivider } from './components';
|
||||
import { CallEmbed, useCallControlState } from '../../plugins/call';
|
||||
import { AsyncStatus, useAsyncCallback } from '../../hooks/useAsyncCallback';
|
||||
import { callEmbedAtom } from '../../state/callEmbed';
|
||||
import { useSetting } from '../../state/hooks/settings';
|
||||
import { settingsAtom } from '../../state/settings';
|
||||
|
||||
type MicrophoneButtonProps = {
|
||||
enabled: boolean;
|
||||
@@ -157,6 +159,9 @@ export function CallControl({
|
||||
}) {
|
||||
const { microphone, video, sound, screenshare } = useCallControlState(callEmbed.control);
|
||||
const setCallEmbed = useSetAtom(callEmbedAtom);
|
||||
const [pttMode] = useSetting(settingsAtom, 'pttMode');
|
||||
const [pttKey] = useSetting(settingsAtom, 'pttKey');
|
||||
const pttKeyLabel = pttMode ? (pttKey === 'Space' ? 'SPACE' : pttKey.replace('Key', '').replace('Digit', '')) : '';
|
||||
|
||||
const [hangupState, hangup] = useAsyncCallback(
|
||||
useCallback(() => callEmbed.hangup(), [callEmbed])
|
||||
@@ -175,10 +180,22 @@ export function CallControl({
|
||||
return (
|
||||
<Box shrink="No" alignItems="Center" gap="300">
|
||||
<Box alignItems="Inherit" gap="200">
|
||||
{pttMode && (
|
||||
<Chip
|
||||
variant="Critical"
|
||||
fill="Soft"
|
||||
radii="300"
|
||||
size="300"
|
||||
outlined
|
||||
style={{ pointerEvents: 'none', fontWeight: 700, letterSpacing: '0.06em' }}
|
||||
>
|
||||
<Text size="T200">PTT {pttKeyLabel}</Text>
|
||||
</Chip>
|
||||
)}
|
||||
<MicrophoneButton
|
||||
enabled={microphone}
|
||||
onToggle={() => callEmbed.control.toggleMicrophone()}
|
||||
disabled={!callJoined}
|
||||
disabled={!callJoined || pttMode}
|
||||
/>
|
||||
<SoundButton
|
||||
enabled={sound}
|
||||
|
||||
Reference in New Issue
Block a user