Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to play repeating after a video ended playing #92

Open
dreamrsio opened this issue Sep 21, 2022 · 5 comments
Open

How to play repeating after a video ended playing #92

dreamrsio opened this issue Sep 21, 2022 · 5 comments

Comments

@dreamrsio
Copy link

How can we enable a video to play again from start after end playing

@dreamrsio dreamrsio added the bug Something isn't working label Sep 21, 2022
@hirbod
Copy link
Contributor

hirbod commented Sep 21, 2022

  const onPlayerStateChange = useCallback(
    (onPlayerStateChange) => {
      if (onPlayerStateChange === 'Ended') {
        playerRef.current?.play();
      }
    },
    []
  );

But I would find a loop prop more convenient too

@maxstoller
Copy link
Contributor

Hi all, thanks for the feedback. We don’t have a loop prop currently, but I will leave this open for others to +1.

@maxstoller maxstoller added feature-request and removed bug Something isn't working labels Sep 23, 2022
@dmahajan980
Copy link

Hey @maxstoller, what should be the ideal way to play videos in loop?

@maxstoller
Copy link
Contributor

Hi @dmahajan980, the code snippet @hirbod provided above should work.

@dawhitla
Copy link
Contributor

dawhitla commented Aug 9, 2023

@dawhitla dawhitla closed this as completed Aug 9, 2023
@dawhitla dawhitla reopened this Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants