-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c0e5e0
commit 78f6d72
Showing
11 changed files
with
142 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,58 @@ | ||
import React from "react"; | ||
import { Grid } from "../../components/TableOfContents/Grid"; | ||
import { TOCItem } from "../../components/TableOfContents/TOCItem"; | ||
import React from 'react'; | ||
import {Grid} from '../../components/TableOfContents/Grid'; | ||
import {TOCItem} from '../../components/TableOfContents/TOCItem'; | ||
|
||
export const TableOfContents: React.FC = () => { | ||
return ( | ||
<div> | ||
<Grid> | ||
<TOCItem link="/docs/studio/get-static-files"> | ||
<strong>{"getStaticFiles()"}</strong> | ||
<div> | ||
Get a list of files in the <code>public</code> folder | ||
</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/watch-public-folder"> | ||
<strong>{"watchPublicFolder()"}</strong> | ||
<div>Listen to changes in the public folder</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/watch-static-file"> | ||
<strong>{"watchStaticFile()"}</strong> | ||
<div>Listen to changes of a static file</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/write-static-file"> | ||
<strong>{"writeStaticFile()"}</strong> | ||
<div>Save content to a file in the public directory</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/save-default-props"> | ||
<strong>{"saveDefaultProps()"}</strong> | ||
<div>Save default props to the root file</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/update-default-props"> | ||
<strong>{"updateDefaultProps()"}</strong> | ||
<div>Update default props in the Props editor</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/delete-static-file"> | ||
<strong>{"deleteStaticFile()"}</strong> | ||
<div>Delete a file from the public directory</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/restart-studio"> | ||
<strong>{"restartStudio()"}</strong> | ||
<div>Restart the Studio Server.</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/focus-default-props-path"> | ||
<strong>{"focusDefaultPropsPath()"}</strong> | ||
<div>Scrolls to a specific field in the default props editor</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/reevaluate-composition"> | ||
<strong>{"reevaluateComposition()"}</strong> | ||
<div>Re-runs calculateMetadata() on the current composition</div> | ||
</TOCItem> | ||
</Grid> | ||
</div> | ||
); | ||
return ( | ||
<div> | ||
<Grid> | ||
<TOCItem link="/docs/studio/get-static-files"> | ||
<strong>{'getStaticFiles()'}</strong> | ||
<div> | ||
Get a list of files in the <code>public</code> folder | ||
</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/watch-public-folder"> | ||
<strong>{'watchPublicFolder()'}</strong> | ||
<div>Listen to changes in the public folder</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/watch-static-file"> | ||
<strong>{'watchStaticFile()'}</strong> | ||
<div>Listen to changes of a static file</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/write-static-file"> | ||
<strong>{'writeStaticFile()'}</strong> | ||
<div>Save content to a file in the public directory</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/save-default-props"> | ||
<strong>{'saveDefaultProps()'}</strong> | ||
<div>Save default props to the root file</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/update-default-props"> | ||
<strong>{'updateDefaultProps()'}</strong> | ||
<div>Update default props in the Props editor</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/delete-static-file"> | ||
<strong>{'deleteStaticFile()'}</strong> | ||
<div>Delete a file from the public directory</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/restart-studio"> | ||
<strong>{'restartStudio()'}</strong> | ||
<div>Restart the Studio Server.</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/seek"> | ||
<strong>{'seek()'}</strong> | ||
<div>Jump to a position in the timeline</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/focus-default-props-path"> | ||
<strong>{'focusDefaultPropsPath()'}</strong> | ||
<div>Scrolls to a specific field in the default props editor</div> | ||
</TOCItem> | ||
<TOCItem link="/docs/studio/reevaluate-composition"> | ||
<strong>{'reevaluateComposition()'}</strong> | ||
<div>Re-runs calculateMetadata() on the current composition</div> | ||
</TOCItem> | ||
</Grid> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
image: /generated/articles-docs-studio-seek.png | ||
title: seek() | ||
crumb: '@remotion/studio' | ||
--- | ||
|
||
# seek()<AvailableFrom v="4.0.259"/> | ||
|
||
Jump to a position in time in the Remotion Studio. | ||
|
||
If a number smaller than 0 is passed, the value will be automatically clamped to 0. | ||
If a number greater than or equal to the duration of the composition is passed, the value will be automatically clamped to `durationInFrames - 1`. | ||
|
||
Use [`useVideoConfig()`](/docs/use-video-config) to get the duration of the composition. | ||
|
||
## Examples | ||
|
||
```tsx twoslash title="Saving {color: 'green'} to Root.tsx" | ||
import {seek} from '@remotion/studio'; | ||
|
||
seek(100); | ||
``` | ||
|
||
## See also | ||
|
||
- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/studio/src/api/seek.ts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {seek} from '@remotion/studio'; | ||
import React, {useCallback} from 'react'; | ||
import {AbsoluteFill} from 'remotion'; | ||
|
||
export const Seek: React.FC = () => { | ||
const onClick = useCallback(() => { | ||
seek(300); | ||
}, []); | ||
|
||
const onSecondClick = useCallback(() => { | ||
seek(10); | ||
}, []); | ||
|
||
const onThirdClick = useCallback(() => { | ||
seek(-10); | ||
}, []); | ||
|
||
return ( | ||
<AbsoluteFill> | ||
<button onClick={onClick}>Seek</button> | ||
<button onClick={onSecondClick}>Seek 10</button> | ||
<button onClick={onThirdClick}>Seek -100</button> | ||
</AbsoluteFill> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
* @description Jump to a different time in the timeline. | ||
* @see [Documentation](https://www.remotion.dev/docs/studio/seek) | ||
*/ | ||
|
||
import {timeValueRef} from '../components/TimeValue'; | ||
|
||
export const seek = (frame: number) => { | ||
timeValueRef.current?.seek(Math.max(0, frame)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters