open sourced a React Native/Expo media feed , called "@rbayuokt/expo-infinite-media"
@rbayuokt6.3K followers
10,692 views
19 Comments
Comments from the original post on X (Twitter)

@rbayuokt
native watches the scroll itself and picks the post on screen. no round trip to JS. it keeps three players in a pool and passes them around. the next post is already prepared and paused. the one after has its first 1,5 MB on disk. AVFoundation on iOS, Media3 on Android
5 likes

@rbayuokt
JS sends the list and draws your overlays. that s the whole job. one event when the page changes, not sixty a second. whatever your render thread is busy with, the video doesn t notice
3 likes

@rbayuokt
caches are bounded. 500 MB video, 200 MB images, LRU, shared by every feed in the app. scroll past something mid download and it gets cancelled, but the bytes that already landed stay. what a post preloaded is exactly what plays, so nothing is fetched twice
4 likes

@rbayuokt
built it for myself… BUT if you re also losing a fight with a video list in react native, it s yours too 😄 hahaha try it here: don t forget the ⭐️
6 likes

@rbayuokt
and that s it. react native is native guys. I literally just showed you... please let this debate rest in peace...
3 likes

@hirbod
@reactnative @expo Interesting, but I achieved the same performance with expo-video, FlashList/LegendList in 2022. I think your Android results are better though
1 like

@rbayuokt
that stack gets close, used it on a client project and the complaints kept coming back to preloading, and nearly all of them were android 🤕 the workarounds never felt right to me so I tried moving it all native, which is probably why android reads better

@frxnsix_
@reactnative @expo Really awesome
1 like

@rbayuokt
thank you so much! 🙏🏻

@shashwat132003
@reactnative @expo 🔥🔥
1 like

@rbayuokt
🙏🏻🙏🏻

@F1SaturnV
@reactnative @expo Thanks for sharing!
1 like

@rbayuokt
you re welcome 🙏🏻

@davidmokos_
@reactnative @expo this is co cool! Thanks for making it opensource
1 like

@rbayuokt
@reactnative @expo thank you so much! really appreciate it 🙌🏻 I'm glad it can be useful to others too!
1 like

@TheErikDahl
@reactnative @expo Going to try this out! Thanks
1 like

@rbayuokt
thank you!

@isninkhamiss
@reactnative @expo So cool
1 like

@rbayuokt
thank you! 🙏🏻