react-insta-stories icon indicating copy to clipboard operation
react-insta-stories copied to clipboard

How to set isPaused as true

Open BenRamins opened this issue 3 years ago • 5 comments

i.e. how to set isPaused as true across all stories in

<Stories
       stories={stories}
/>

Currently if you set isPaused to true in <Stories> it only affects the first story in the sequence and it skips it altogether and moves on to the second story.

I feel like this is necessary to start to enable video stories to play with sound on iOS. The goal would be for the stories to load but are paused, and at first action from the user, proceeds as normal.

for reference. this PR #103 fixed it so that videos play but without sound (instead of a black screen)

BenRamins avatar Mar 19 '21 02:03 BenRamins

Create your local state and change it value according to your requirements and pass it as variable const [paused, setPaused] = useState(false);

and in component

  return <Stories stories={tData} defaultInterval={5000} isPaused={paused} width="100%" height="100%" />;

HrithikMittal avatar Feb 26 '22 02:02 HrithikMittal

Create your local state and change it value according to your requirements and pass it as variable const [paused, setPaused] = useState(false);

and in component

  return <Stories stories={tData} defaultInterval={5000} isPaused={paused} width="100%" height="100%" />;

This doesn't appear to have any effect on my stories. Event by setting isPaused={true} it still autoplays.

KudMath avatar Sep 12 '22 15:09 KudMath

I fixed this in https://github.com/mohitk05/react-insta-stories/pull/240, but awaiting merge

ReiiYuki avatar Dec 02 '22 06:12 ReiiYuki

fantastic work with the fix @ReiiYuki . This would be super useful for visual diffing for example where you want the animations to be paused. Any change this can be reviewed and released @mohitk05 ?

fernando-noah avatar Dec 08 '22 12:12 fernando-noah

When does it supposed to be merged?

Skriptach avatar Feb 16 '23 14:02 Skriptach