Skip to content

<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 ​

proptypedefaultrequireddescription
idstringyesThe cue's name.
startnumber (0..∞) | stringyesWhen it appears: seconds, or a word of the captions' source (word:12).
endnumber (0..∞) | stringyesWhen it goes, as start.
textstringyesWhat 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

MIT licensed.