aws / amazon-ivs-react-native-player

A React Native wrapper for the Amazon IVS iOS and Android player SDKs.
Apache License 2.0
299 stars 31 forks source link

How to play repeating after a video ended playing #92

Open dreamrsio opened 2 years ago

dreamrsio commented 2 years ago

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

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

But I would find a loop prop more convenient too

maxstoller commented 2 years ago

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

dmahajan980 commented 1 year ago

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

maxstoller commented 1 year ago

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

dawhitla commented 1 year ago

Hi @dreamrsio we now have support for loop

https://github.com/aws/amazon-ivs-react-native-player/blob/main/docs/ivs-player-reference.md#loop-optional