0

Is there a callback for when video das ended in video-react? I need to make it so another component will only be available (appear on page) when the user has reached the end of the video.

Here's my player component:

export default props => {
    return (
      <Player poster={poster} fluid="false" on="ended">
        <BigPlayButton position="center" />
        <source src={video} />

        <ControlBar>
          <ReplayControl seconds={10} order={1.1} />
          <VolumeMenuButton enabled />
        </ControlBar>
      </Player>
    );
  };```

1 Answers1

0

It looks like <Player> accepts an undocumented onEnded prop: https://github.com/video-react/video-react/blob/5ba018d095c9a00572d91ecbf853450a150f480f/src/components/Player.js#L44

I'm not familiar enough with the library to know whether or not this is the same Player that you're importing or if there's a wrapper, but it seems worth trying.

coreyward
  • 77,547
  • 20
  • 137
  • 166