Video by HeyTimDev · streamed from YouTube. All rights remain with the creator.
Lesson 10: A Home Feed with Video Playback
About this lesson
In this video, HeyTimDev adds the home feed to the short-video app, so that users can scroll through videos one after another, just as in the real app. It uses Supabase for the data and Expo's audio and video library to display and play the videos dynamically as the user moves through the feed. The video begins by fetching the video data from Supabase and generating signed URLs for the stored files, which give the app secure, temporary access to each video rather than leaving the files open to anyone. The videos are then displayed in a FlatList, React Native's efficient list component, set up so that scrolling through the feed feels seamless. Each item uses the video player from Expo's library to play its clip in the feed. The key technique of the video is using FlatList's viewable items callback to work out which video is currently on screen, so that videos play and pause automatically as users scroll, with only the visible one playing at any moment. Alongside the playback, the feed dynamically loads information about each video, such as the creator's user data and the video's title, and displays it with the clip. By the end of the video, the app has a fully functional home feed where users can scroll through videos and watch them play automatically, much like the real thing, and the next part adds overlays with profile information, likes and sharing. Afterwards, read Chapter 10 of the course book, which works out when the feed switches from one video to the next by hand.