Skip to content

🎥 Make videos programmatically with React

only jump to start

Jonny Burgerf8b838caccb2
diff --git a/packages/cli/src/editor/components/PlayPause.tsx b/packages/cli/src/editor/components/PlayPause.tsx
index 72f2b160be..ded03fd26d 100644
--- a/packages/cli/src/editor/components/PlayPause.tsx
+++ b/packages/cli/src/editor/components/PlayPause.tsx
@@ -3,6 +3,7 @@ import React, {useCallback, useEffect} from 'react';
import {Internals} from 'remotion';
import {useIsStill} from '../helpers/is-current-selected-still';
import {useKeybinding} from '../helpers/use-keybinding';
+import {JumpToStart} from '../icons/jump-to-start';
import {Pause} from '../icons/pause';
import {Play} from '../icons/play';
import {StepBack} from '../icons/step-back';
@@ -11,7 +12,6 @@ import {ControlButton} from './ControlButton';
const forwardBackStyle = {
height: 16,
- width: 16,
color: 'white',
};
@@ -87,14 +87,6 @@ export const PlayPause: React.FC<{
seek(0);
}, [seek]);
- const jumpToEnd = useCallback(() => {
- if (!video) {
- return;
- }
-
- seek(video.durationInFrames - 1);
- }, [seek, video]);
-
const keybindings = useKeybinding();
useEffect(() => {
@@ -129,7 +121,7 @@ export const PlayPause: React.FC<{
disabled={frame === 0}
onClick={jumpToStart}
>
- <StepBack style={forwardBackStyle} />
+ <JumpToStart style={forwardBackStyle} />
</ControlButton>
<ControlButton
aria-label="Step back one frame"
@@ -173,14 +165,6 @@ export const PlayPause: React.FC<{
>
<StepForward style={forwardBackStyle} />
</ControlButton>
- <ControlButton
- aria-label="Jump to end"
- title="Jump to end"
- disabled={isLastFrame}
- onClick={jumpToEnd}
- >
- <StepForward style={forwardBackStyle} />
- </ControlButton>
</>
);
};
diff --git a/packages/cli/src/editor/icons/jump-to-start.tsx b/packages/cli/src/editor/icons/jump-to-start.tsx
new file mode 100644
index 0000000000..1f049d51bb
--- /dev/null
+++ b/packages/cli/src/editor/icons/jump-to-start.tsx
@@ -0,0 +1,12 @@
+import {SVGProps} from 'react';
+
+export const JumpToStart: React.FC<SVGProps<SVGSVGElement>> = (props) => {
+ return (
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" {...props}>
+ <path
+ fill="currentColor"
+ d="M0 415.1V96.03c0-17.67 14.33-31.1 31.1-31.1C49.67 64.03 64 78.36 64 96.03v131.8l171.5-156.5C256.1 54.28 288 68.66 288 96.03v131.9l171.5-156.5C480.1 54.28 512 68.66 512 96.03v319.9c0 27.37-31.88 41.74-52.5 24.62L288 285.2v130.7c0 27.37-31.88 41.74-52.5 24.62L64 285.2v130.7c0 17.67-14.33 31.1-31.1 31.1C14.33 447.1 0 433.6 0 415.1z"
+ />
+ </svg>
+ );
+};