Closed malhotrachetan closed 4 years ago
Hey @debuggermalhotra. 👋 I can see from the starter code that you are already utilizing onViewableItemsChanged
. I would suggest you to try playing/pausing videos using that functionality. There is no need to use both Viewport.Tracker
and onViewableItemsChanged
for the same FlatList
. The Skele tracker is very useful for ScrollView
, but for FlatList
, onViewableItemsChanged
can work better in some cases.
I see. Yeah on the events of viewport.tracker not responding correctly to flatlist i was experimenting with onViewableItemsChanged. I think i will have to move ahead with that only. Thanks for the help @bevkoski Cheers!
I am using this RN library called react-native-snap-carousal that is basically an animated FlatList. The item that is rendered with this carousal is a component containing a video(expo av video) and some text. With the help of viewport from @skele/components i am trying to play the video when it enters the viewport and pause the video when it leaves the viewport. All videos do render, it's just that i cannot see some of the videos but can only hear them. If i remove the from the RN-snap-carousal component, all videos render perfectly with both audios and visuals.
Here is some starter code:
This happens on both ios and android but ios one is a frequent occurrence. Also on ios, the first video always skips out on visual part i.e. first video is always just audio. I am happy to answer any more questions you folks have if this isn't enough. I would really really appreciate some assistance with this as this is a blocking one for me. Kudos! Thanks in advance.