Expo Video Component Won't Play Video Stream

#1

Hey all - I’m using the Expo Video component to play a stream. If the video stream is playing prior to opening the application, the Video component loads and plays the video stream no problem. However, if I open the app and then begin the stream, the Video component doesn’t play it -I have to refresh the app to see the stream. Any insight into what I’m doing wrong? Here’s a snack for reference.

https://snack.expo.io/@ads1018/video-test

Note: the only way to really debug this is by stopping and playing a .m3u8 stream.

0 Likes

#2

So it turns out it’s because the video can’t load if the stream doesn’t yet exist (obviously). What I ended up doing was load the stream every second inside a setInterval until it becomes available.

0 Likes

#3

recommend you don’t use setInterval: https://zetafleet.com/blog/2010/04/why-i-consider-setinterval-to-be-harmful.html

0 Likes

closed #4

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

0 Likes