0

I'm trying to show a video from AWS (.m3u8 format) on my Expo-App. I'm using the video component from expo-av. It is working perfectly fine on Android but I can't get the video showing on iOS. My code is almost the same as in the Expo-docs.

The code:

const uri = "https://__censored__.cloudfront.net/__censored__/hls/TitleOfTheVideo.m3u8"

<Video
  source={{ uri, overrideFileExtensionAndroid: 'm3u8' }}
  rate={1.0}
  volume={1.0}
  isMuted={true}
  resizeMode="contain"
  shouldPlay
  style={{ width: '100%', aspectRatio: 16/9, backgroundColor: '#000' }}
  useNativeControls
/>

Is this a general problem with iOS or am I doing something wrong? Has anybody worked with HLS videos and Expo before and knows a better approach? I'm new to AWS and haven't worked with Expo in a while so I would be happy for any advice you guys can give me.

Zander
  • 402
  • 1
  • 4
  • 17
  • 1
    Tried to set "shouldPlay={true}" or is it true by default? – Erik Dreifaldt Oct 21 '20 at 13:44
  • @EriDr yes it's true by default. When I change the video uri to the uri in the Expo-Docs it's working on iOS (This is the url: ('http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4') – Zander Oct 21 '20 at 13:47
  • @Andreas thank you for your comment. I didn't know that before. But I just tried using the mp4 url from cloudfront and even with that the video is not showing on iOS but it's showing on Android. – Zander Oct 21 '20 at 13:48
  • Seems like a few people have had problems with other m3u8 files in iOS on both emulators and actual devices so exporting the video as mp4 should do the trick. – Erik Dreifaldt Oct 21 '20 at 14:14
  • As I said: I just tried using the mp4 url from cloudfront and even with that the video is not showing on iOS. So it's probably more a problem with cloudfront. – Zander Oct 21 '20 at 14:33
  • And you used 'http://'? That one works fine for me. – Erik Dreifaldt Oct 21 '20 at 14:43
  • I used: https://d____qki29e27m.cloudfront.net/___43-dc20-4f0f-bb58-12933378de52/mp4/F5.titleOfTHeVideo_16x9_1920x1080p_24Hz_6Mbps_qvbr.mp4 And it didn't work. – Zander Oct 21 '20 at 14:49

0 Answers0