0

I have a list of objects that contain a video or photo

I would like to make scrolling possible (up - down - up, something like in TikTok). Each card has a full-screen image or video.

For this I used the library:

https://www.npmjs.com/package/react-native-swiper

Scrolling works as intended, but there are other problems:

  • all objects load immediately (there should be some pagination)

  • all objects start immediately (when the video has sound then everyone starts playing)

Is there another useful solution or can something be done with this library?

DeveloperApps
  • 763
  • 7
  • 16

1 Answers1

0

How about using onIndexChanged={(index) => this.setState({index})} to set and get the index

And then set Video disable auto play.

If this.state.index equal that page, then that video plays start or it pause?

高鵬翔
  • 1,997
  • 2
  • 8
  • 21