Capítulo 75 de 988
With this hook, you can retrieve the current frame of the video. Frames are 0-indexed, meaning the first frame is 0, the last frame is the duration of the composition in frames minus one.
const Title = () => {
const frame = useCurrentFrame(); // 25
return <div>{frame}</div>;
};
const Subtitle = () => {
const frame = useCurrentFrame(); // 15
return <div>{frame}</div>;
};
const MyVideo = () => {
const frame = useCurrentFrame(); // 25
return (
<div>
<Title />
<AbsoluteFill from={10}>
<Subtitle />
</AbsoluteFill>
</div>
);
};