marcusstenbeck / remotion-transition-series

Remotion <Series/> component with transitions
72 stars 7 forks source link

Can't use useCurrentFrame hook inside the TransitionSeries #2

Open goveo opened 1 year ago

goveo commented 1 year ago

Hey, thanks for the lib!

I'm trying to use it, but the remotion Player component throws the following error:

use-current-frame.js:16 Uncaught Error: useCurrentFrame can only be called inside a component that was passed to <Player>. See: https://www.remotion.dev/docs/player/examples

I'm trying to use TransitionSeries with IntroComposition and OutroComposition remotion composition components:

<AbsoluteFill style={{ backgroundColor: 'black' }}>
  <TransitionSeries>
    <TransitionSeries.Sequence durationInFrames={300}>
      <IntroComposition />
    </TransitionSeries.Sequence>

    <TransitionSeries.Transition
      durationInFrames={15}
      transitionComponent={LinearWipe}
    />

    <TransitionSeries.Sequence durationInFrames={300}>
      <OutroComposition />
    </TransitionSeries.Sequence>
  </TransitionSeries>
</AbsoluteFill>

And my composition components use the useCurrentFrame() hook inside.

Is it possible to somehow use useCurrentFrame in that case?

goveo commented 1 year ago

I've opened a similar issue in the remotion repo: https://github.com/remotion-dev/remotion/issues/2578