<Caption>
One cue inside <Captions>, written by hand: its text, start and end.
tsx
import { Captions, Clip, Composition, Track } from "@cutcraft/kit";
export default function Video() {
return (
<Composition fps={30} width={540} height={960}>
<Track id="main">
<Clip id="talk" src="asset:speaker" in="word:0" out="word:12.end" fit="cover" />
</Track>
{/* Words come from the clip's transcript and follow it through every trim. */}
<Captions id="captions" src="asset:speaker" animation="karaoke" style={{ size: 36 }} />
</Composition>
);
}Used in: the walkthrough
Props
| prop | type | default | required | description |
|---|---|---|---|---|
id | string | yes | The cue's name. | |
start | number (0..∞) | string | yes | When it appears: seconds, or a word of the captions' source (word:12). | |
end | number (0..∞) | string | yes | When it goes, as start. | |
text | string | yes | What it says. | |
words | { text, start, end }[] | Each word and its time in the video, in seconds, which the word animations highlight; left out, the cue shows as plain text. |
Timed, visual. No children. All elements