react-native-video: Meet "AVFoundationErrorDomain" error when loading a remote url

Here’s my code: source={{uri: "http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4"}}

Then it triggered loadError function which shows error object like this: { error: { domain: 'AVFoundationErrorDomain', code: -11800 }, target: 14 }

I’ve made a huge search and still have no idea.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 21
  • Comments: 18 (5 by maintainers)

Most upvoted comments

i’m getting the same error. nothing in log.

i had to NSLog(@“%@”, _playerItem); in RCTVideo.m to print out the real error Transport security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file

and found the solution here. basically you have to enable http or use https http://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http

I also can’t play https video URLs. Getting this kind of error objects:

{
    error: {
        domain: "AVFoundationErrorDomain", 
        code: -11828
    },
    target: 109
}

I was still having this issue but this solved it

source={{ uri: “your uri here”, type: ‘mp4’ }}

I’m also facing this issue, I’m using this video:

https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4

It seems they’re sending all the correct headers:

accept-ranges: bytes
access-control-allow-origin: *
access-control-expose-headers: origin, range
alt-svc: quic=":443"; ma=2592000; v="46,43,39"
cache-control: public, max-age=3600
content-length: 158008374
content-type: video/mp4
date: Tue, 06 Aug 2019 20:16:19 GMT
etag: "cab08b36195edb1a1231d2d09fa450e0"
expires: Tue, 06 Aug 2019 21:16:19 GMT
last-modified: Thu, 05 Dec 2013 18:43:53 GMT
server: UploadServer
status: 200