Add ability to export from recordings page (#10692)

* Add dialog to export recordings

* Add export dialog functionality

* Add ability to name exports

* Add ability to choose custom time range on timeline

* Add ability to choose custom time range on timeline

* Add custom time selection

* Make hot keys optional for typing name of export

* Tweaks to dialog

* Tweaks to dialog

* round corners more

* Final tweaks
This commit is contained in:
Nicolas Mowen
2024-03-26 15:37:45 -06:00
committed by GitHub
parent c82ed43c13
commit 8f69edeb33
10 changed files with 483 additions and 18 deletions

View File

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

View File

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

View File

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