Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

Flatlist of videos does not render in react native

$
0
0

I have a list of videos rendering, and after 32 videos render I receive this error:

domain: "AVFoundationErrorDomain", code: -11839

This is because iOS will only allow 32 video players to be instantiated at once. How, then, can I get rid of some of the video players? The Flatlist is horizontal and wrapped by a vertically scrolling recyclerlist view. The code for the flatlist is here:

<FlatList
                    ref={(ref) => { this.flatListRef = ref }}
                    data={this.state.posts}
                    extraData={this.state}
                    onScroll={(e) => this.pauseAll(e)}
                    showsHorizontalScrollIndicator={false}
                    scrollEnabled={this.state.isPortrait}
                    horizontal={true}
                    renderAheadOffset={0}
                    initialNumToRender={3}
                    windowSize={3}
                    removeClippedSubviews={true}
                    pagingEnabled={true}
                    keyExtractor={(row, id) => id.toString()}
                    renderItem={(row, id) => (this.renderVideos())}
/>

My understanding is that recyclerlistview would not hold each row in memory, only the dimensions, but all 32 videos are in memory.

Another way to put this is that original video players do not unmount when out of view?


Viewing all articles
Browse latest Browse all 16552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>