-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
react native Video with flatList (with multiple video) on Scrolling App not responding and crashed the app #3058
Comments
Your UI was blocked because Your UI is likely freezing because the listing is not optimized, either because you are displaying many heavy elements or because there is a design anti-pattern in your code causing multiple renders depending on state variables that are being updated. But without a code sample, it's difficult to know for sure. |
@LucasHimelfarb i have an api call 10 data per page and there is multiple state variable for video play/pause, mute/unmute etc loading opacity, and if i use a log that will print 10 times for the first rendering ...how can i improve the performance? |
i am getting same issue as well. |
@iasreact1 @krunalinfynno Im sorry for the late answer. The Flatlist`ve many props to improve perfomance, for example the props "removeClippedSubviews" and "getItemLayout". You can see all props here: https://reactnative.dev/docs/flatlist If anyone have some issue please share some code to detect common problems |
@LucasHimelfarb |
If someone can provide a sample app, it would be very useful to reproduce (and fix) the issue! |
@KrzysztofMoch can you please have a quick look to this callstack ? |
regarding to the initial issue, I created a flat list sample here: https://github.com/freeboub/react-native-video-flatlist-sample |
Seems like crash is caused by setting some metadata properties (probably image) |
@EuSet It would need to be tracked in a dedicated ticket @KrzysztofMoch On this line, asset is nil ? let metadata = currentItem.asset.commonMetadata + currentItem.externalMetadata |
@freeboub no it would crash differently - it will be lower, probably in place when we are setting NowPlayingInfo data eg artwork |
@EuSet can you please open a new ticket, I close this one. |
I am using react-native-video-5.2.1, don't know whether use android exo-Player or mediaPlayer. There are so many videos in the flatlist and when get Scrolled it get stuck the UI and app not responding error, Please help what to do for solving it, but if i use the video plaer to another page for playing the video then it working fine but when playing the video within the Flatlist ANR is coming every time & every Device, Please help ...to overcome it..
The text was updated successfully, but these errors were encountered: