Make hot keys optional for typing name of export

This commit is contained in:
Nicolas Mowen 2024-03-26 15:03:06 -06:00
parent 6c783ff04a
commit 5ca8a9001b
5 changed files with 11 additions and 1 deletions

View File

@ -112,6 +112,7 @@ export default function ExportDialog({
); );
setName(""); setName("");
setRange(undefined); setRange(undefined);
setSelectedOption("1");
} }
}) })
.catch((error) => { .catch((error) => {

View File

@ -22,6 +22,7 @@ type HlsVideoPlayerProps = {
videoRef: MutableRefObject<HTMLVideoElement | null>; videoRef: MutableRefObject<HTMLVideoElement | null>;
visible: boolean; visible: boolean;
currentSource: string; currentSource: string;
hotKeys: boolean;
onClipEnded?: () => void; onClipEnded?: () => void;
onPlayerLoaded?: () => void; onPlayerLoaded?: () => void;
onTimeUpdate?: (time: number) => void; onTimeUpdate?: (time: number) => void;
@ -33,6 +34,7 @@ export default function HlsVideoPlayer({
videoRef, videoRef,
visible, visible,
currentSource, currentSource,
hotKeys,
onClipEnded, onClipEnded,
onPlayerLoaded, onPlayerLoaded,
onTimeUpdate, onTimeUpdate,
@ -161,6 +163,7 @@ export default function HlsVideoPlayer({
controlsOpen={controlsOpen} controlsOpen={controlsOpen}
setControlsOpen={setControlsOpen} setControlsOpen={setControlsOpen}
playbackRate={videoRef.current?.playbackRate ?? 1} playbackRate={videoRef.current?.playbackRate ?? 1}
hotKeys={hotKeys}
onPlayPause={(play) => { onPlayPause={(play) => {
if (!videoRef.current) { if (!videoRef.current) {
return; return;

View File

@ -41,6 +41,7 @@ type VideoControlsProps = {
controlsOpen?: boolean; controlsOpen?: boolean;
playbackRates?: number[]; playbackRates?: number[];
playbackRate: number; playbackRate: number;
hotKeys?: boolean;
setControlsOpen?: (open: boolean) => void; setControlsOpen?: (open: boolean) => void;
onPlayPause: (play: boolean) => void; onPlayPause: (play: boolean) => void;
onSeek: (diff: number) => void; onSeek: (diff: number) => void;
@ -55,6 +56,7 @@ export default function VideoControls({
controlsOpen, controlsOpen,
playbackRates = PLAYBACK_RATE_DEFAULT, playbackRates = PLAYBACK_RATE_DEFAULT,
playbackRate, playbackRate,
hotKeys = true,
setControlsOpen, setControlsOpen,
onPlayPause, onPlayPause,
onSeek, onSeek,
@ -130,7 +132,7 @@ export default function VideoControls({
[video, isPlaying, onSeek], [video, isPlaying, onSeek],
); );
useKeyboardListener( useKeyboardListener(
["ArrowLeft", "ArrowRight", "m", " "], hotKeys ? ["ArrowLeft", "ArrowRight", "m", " "] : [],
onKeyboardShortcut, onKeyboardShortcut,
); );

View File

@ -20,6 +20,7 @@ type DynamicVideoPlayerProps = {
cameraPreviews: Preview[]; cameraPreviews: Preview[];
startTimestamp?: number; startTimestamp?: number;
isScrubbing: boolean; isScrubbing: boolean;
hotKeys: boolean;
onControllerReady: (controller: DynamicVideoController) => void; onControllerReady: (controller: DynamicVideoController) => void;
onTimestampUpdate?: (timestamp: number) => void; onTimestampUpdate?: (timestamp: number) => void;
onClipEnded?: () => void; onClipEnded?: () => void;
@ -31,6 +32,7 @@ export default function DynamicVideoPlayer({
cameraPreviews, cameraPreviews,
startTimestamp, startTimestamp,
isScrubbing, isScrubbing,
hotKeys,
onControllerReady, onControllerReady,
onTimestampUpdate, onTimestampUpdate,
onClipEnded, onClipEnded,
@ -172,6 +174,7 @@ export default function DynamicVideoPlayer({
videoRef={playerRef} videoRef={playerRef}
visible={!(isScrubbing || isLoading)} visible={!(isScrubbing || isLoading)}
currentSource={source} currentSource={source}
hotKeys={hotKeys}
onTimeUpdate={onTimeUpdate} onTimeUpdate={onTimeUpdate}
onPlayerLoaded={onPlayerLoaded} onPlayerLoaded={onPlayerLoaded}
onClipEnded={onClipEnded} onClipEnded={onClipEnded}

View File

@ -322,6 +322,7 @@ export function RecordingView({
timeRange={currentTimeRange} timeRange={currentTimeRange}
cameraPreviews={allPreviews ?? []} cameraPreviews={allPreviews ?? []}
startTimestamp={playbackStart} startTimestamp={playbackStart}
hotKeys={exportMode != "select"}
onTimestampUpdate={(timestamp) => { onTimestampUpdate={(timestamp) => {
setPlayerTime(timestamp); setPlayerTime(timestamp);
setCurrentTime(timestamp); setCurrentTime(timestamp);