Expo AV will not load video

I’m having trouble loading video in Expo AV component. The code looks like this:

<Video
   source={{ uri: item.url }}
   rate={1.0}
   volume={1.0}
   isMuted={true}
   resizeMode="contain"
   isLooping
   shouldPlay
   onLoad={this.handleLoaded}
   onError={this.handleError(item.url)}
   style={{ width: 300, height: 300 }}
 />

Console will log error on ios " The AVPlayerItem instance has failed with the error code -1002 and domain “NSURLErrorDomain”."
The video will not load on android either but i can’t get any errors.
If I open the source url in the browser, everything works fine.
If I use different video (http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4), the video loads and plays properly.

Are there some source url requirements for the AV?
The source url looks like this:

myPlaceholderApi.com/stream.php?id=421&token=TOKEN

I’m using SDK 37 on android and ios.

Finally fixed it. The problem was in the url, which didn’t contain ‘https://’.

1 Like

Glad you got to the bottom of things. Thanks for sharing the solution with everyone as well! :clap:

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