Skip navigation
open sourced a React Native/Expo media feed , called "@rbayuokt/expo-infinite-media"
0:00 / 1:29

open sourced a React Native/Expo media feed , called "@rbayuokt/expo-infinite-media"

abipraya;

@rbayuokt6.3K followers

Visit on X
294 likesDownloadOriginal post

10,692 views

open sourced a React Native/Expo media feed , called "@rbayuokt/expo-infinite-media" every feed I built died the same way. a Flat/shList <Video> per row, two playing audio at once, black frames whenever JS got busy 😪 so I took playback away from JS. all of it runs native now

19 Comments

Comments from the original post on X (Twitter)

  • abipraya;'s profile picture

    @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

  • abipraya;'s profile picture

    @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

  • abipraya;'s profile picture

    @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

  • abipraya;'s profile picture

    @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

  • abipraya;'s profile picture

    @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's profile picture

    @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

  • abipraya;'s profile picture

    @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

  • El magnifico🌟's profile picture

    @frxnsix_

    @reactnative @expo Really awesome

    1 like

  • abipraya;'s profile picture

    @rbayuokt

    thank you so much! 🙏🏻

  • Shashwat's profile picture

    @shashwat132003

    @reactnative @expo 🔥🔥

    1 like

  • abipraya;'s profile picture

    @rbayuokt

    🙏🏻🙏🏻

  • The Engineer's profile picture

    @F1SaturnV

    @reactnative @expo Thanks for sharing!

    1 like

  • abipraya;'s profile picture

    @rbayuokt

    you re welcome 🙏🏻

  • David Mokos's profile picture

    @davidmokos_

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

    1 like

  • abipraya;'s profile picture

    @rbayuokt

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

    1 like

  • Erik Dahl's profile picture

    @TheErikDahl

    @reactnative @expo Going to try this out! Thanks

    1 like

  • abipraya;'s profile picture

    @rbayuokt

    thank you!

  • thoriq's profile picture

    @isninkhamiss

    @reactnative @expo So cool

    1 like

  • abipraya;'s profile picture

    @rbayuokt

    thank you! 🙏🏻