Skip to content
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

FlatList Support #2668

Closed
hueniverse opened this issue Apr 29, 2022 · 30 comments
Closed

FlatList Support #2668

hueniverse opened this issue Apr 29, 2022 · 30 comments
Labels
bug help wanted The issue has been reviewed and is valid, and is waiting for someone to work on it.

Comments

@hueniverse
Copy link
Contributor

hueniverse commented Apr 29, 2022

This issue consolidates multiple reports of problems with rendering multiple videos in a FlatList: #908, #2667, #2414, #2325,
#1636, #1318, #433, #2247

@hueniverse
Copy link
Contributor Author

It seems to be specific to Android, but would be good to get confirmation on that.

@hueniverse hueniverse added bug help wanted The issue has been reviewed and is valid, and is waiting for someone to work on it. labels Apr 29, 2022
@freeboub
Copy link
Collaborator

Thanks for opening this 'master ticket', i am wondering if someone tryed to change surfaceview / textureview props ?

https://github.com/react-native-video/react-native-video#usetextureview

@swikars1
Copy link

swikars1 commented May 3, 2022

I think many other multiple issues are connected to exoplayer being outdated, I have not faced much issue with IOS but its a mess in android. I am using it with flipkart's recycler list view.

  • My errors persists while using the surface view as well.
  • Some time audio keeps playing but video is frozen
  • Some videos simply doesn't play at all and throws this error: {"e": {"error": {"extra": -1004, "what": 1}}}

@hueniverse
Copy link
Contributor Author

@swikars1 we have a VIP PR to upgrade to the latest version. We need help with getting it finished.

@doublex
Copy link

doublex commented May 12, 2022

This worked for me:
#2384 (comment)

@swikars1
Copy link

@hueniverse I wish I could help man, I'm from Javascript world and everything here seems so alien to me.

@dancixx
Copy link

dancixx commented May 15, 2022

@hueniverse #2667 issue appears on ios too. I spent a lot of time investigating this issue, and I found, that the iOS AV pipeline will be full and can't detach from the memory, and if the app creates too many player instances then won't mount any new videos.

@rahulpandey
Copy link

rahulpandey commented May 17, 2022

For me following implementation working fine for flatlist. I don't find any issue so for

https://gist.github.com/rahulpandey/b7c8a6964d753bd482daea153341b465.

"react-native-video": "^5.2.0"

@siddharth-kt
Copy link

Hi @hueniverse,

Just asking, what do you think, by when this issue will be resolved? 🙂

@hueniverse
Copy link
Contributor Author

@siddharth-kt No clue. No one has offered to work on this.

@siddharth-kt
Copy link

🙁 Sad to hear that, I wanted to contribute but can't due to no knowledge in native.
but thanks for answering.

@Lakston
Copy link

Lakston commented Nov 21, 2022

I don't have the flatlist issue rendering black in alpha 3 but the videos are choppy, the playback is long to start, it seems like the videos are not buffering properly

@mhtchawlaAntino
Copy link

@hueniverse #2667 issue appears on ios too. I spent a lot of time investigating this issue, and I found, that the iOS AV pipeline will be full and can't detach from the memory, and if the app creates too many player instances then won't mount any new videos.

found any solution yet?

@vemarav
Copy link

vemarav commented Jun 18, 2023

@hueniverse playing multiple videos at once is a hardware limitation, thats why youtube also preview one video at a time when in focus. To give better experience one can show thumbnail where video paused and resume from there by remounting video component.

#3153

If still facing avc decoder failure then replace ReactExoplayerViewManager dropViewManager instance with

    // ReactExoplayerViewManager.java
    @Override
    public void onDropViewInstance(ReactExoplayerView view) {
        view.release();
    }

then define release() method inside ReactExoplayerView.java

    // ReactExoplayerView.java
    public void release() {
        player.release()
    }

@brunolcarlos
Copy link

This package works better than FlatList but its not perfect
react-native-big-list

@vemarav
Copy link

vemarav commented Jul 4, 2023

@wolfxpertlab
Copy link

same issue here my report is #3251 (comment)

please tell me how can I solved it some time not play video and also check alpha version

@vemarav
Copy link

vemarav commented Oct 5, 2023

@wolfxpertlab setup a meet for [email protected], maybe I can help 🙂

@davidgvf
Copy link

any solution??

crash my app

<FlatList
ref={FlatlistRef}
data={feed}
windowSize={8}
showsVerticalScrollIndicator={false}
getItemLayout={getItemLayout}
pagingEnabled
decelerationRate={'fast'}
onViewableItemsChanged={onViewRef.current}
viewabilityConfig={viewConfigRef.current}
keyExtractor={keyExtractor}
refreshControl={refreshControl}
ListFooterComponent={
isLoading ? (
<View style={{ paddingVertical: 20 }}>
<ActivityIndicator
size={'large'}
color={colors.white.c100}
/>

) : null
}
renderItem={renderItem}
/>

                    my renderItem:
                     <Video
            paused={props.paused}
            style={[styles.backgroundVideo, props.styles]}
            resizeMode={props.resizeMode || ResizeMode.COVER}
            source={{
                uri: convertToProxyURL(internalVideo.uri),
                type: getTypeVideo(internalVideo.uri)
            }}
            repeat={props.repeat}
            playInBackground={true}
            bufferConfig={
                props.bufferConfig || {
                    minBufferMs: 125,
                    maxBufferMs: 25000,
                    bufferForPlaybackMs: 120,
                    bufferForPlaybackAfterRebufferMs: 122
                }
            }
            onBuffer={e => {
                e.isBuffering !== isBuffering && setIsBuffering(e.isBuffering);
            }}
            onError={e => {
                console.info('video error: ', e);
            }}
            onLoad={() => setIsLoading(false)}
        />

@freeboub
Copy link
Collaborator

For people how stuck on decoder error, Can you try following patch: #3416
It should improve behavior in case of decoder issue

@freeboub
Copy link
Collaborator

To be retested on beta.6

@vishalhyperspace
Copy link

Any solution?
I am getting black screen when using video inside flatlist.
Please help
Thanks in advance.

@avencat
Copy link
Contributor

avencat commented May 6, 2024

@vishalhyperspace which version are you using? @freeboub said v6.0.0-beta.6 should fix this issue (though you could install the latest version to date which is v6.0.0-rc.0

@longphi97
Copy link

@avencat I'm having the same problem as @vishalhyperspace

@avencat
Copy link
Contributor

avencat commented May 29, 2024

@longphi97 on which version?

@longphi97
Copy link

@avencat version 6.1.2

@avencat
Copy link
Contributor

avencat commented May 29, 2024

Ok @freeboub do you think @longphi97 should open a new issue with more information?

@avencat
Copy link
Contributor

avencat commented May 29, 2024

In the meantime, @longphi97 maybe you should try to open a snack where you reproduce this error! 😉

@shivnath17
Copy link

Is there any update on the blank screen thing in android?

I'm using the latest version v6.8.1 Still getting the blank screen in flatlist on scroll.

@thiennhank9
Copy link

Is there any update on the blank screen thing in android?

I'm using the latest version v6.8.1 Still getting the blank screen in flatlist on scroll.

Same here, use the latest version, still get the blank screen if the video is under the flatlist, and is not in the current viewport while scrolling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted The issue has been reviewed and is valid, and is waiting for someone to work on it.
Projects
None yet
Development

No branches or pull requests