react-native-video: Video not playing sometimes with onError payload {extra: -5001, what: 1}

Current behavior

Forgive my ignorance please, but is there a way to look up what these errors mean? I’ve tried googling a bit and haven’t really come up with much. The only thing I’ve found potentially related to this is issue #1105 , but the weird thing is that using the same external device(Samsung Tab A, Android 7.1.1), Sometimes it loads and plays the video just like normal and sometimes it doesn’t. Which leads me to believe it has something to do with my code, but I’m having trouble figuring out what.

This is the error object i get from my onError method { extra: -5001, what: 1 }. Does that mean anything to anyone? Or can anyone point me in the right direction towards figuring out what that means?

I’ll post more code and such if the error doesn’t really point me anywhere. It’s just a lot…

Expected behavior

Video loads and plays

Platform

Which player are you experiencing the problem on:

  • Android MediaPlayer

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 6
  • Comments: 23 (3 by maintainers)

Most upvoted comments

I am getting this {extra: -2147483648, what: 1}.

It’s a very random behavior though

Same problem. Was working in the past.

{ error: { extra: -2147483648, what: 1 } }

@Shivendra30 @PosSoolutions @brunocrpontes

I also had this error, as shown with onError prop: { error: { extra: -2147483648, what: 1 } }. Here’s what that error means as defined by stackoverflow - in short, UNKNOWN_ERROR in hex.

After a lot of digging, the solution for me was to remove underscores from the filename. That’s it.

My assets are loaded as follows:

const url = require('./assets/filenamewithoutunderscores.mp4');

And it works fine. Literally - removing underscores from the filename fixes things.

Essentially, judging by the whole host of errors shown on stackoverflow and the internet this is a generic error returned when the media player can’t locate or play your video. For some people, that’s because HTTP is disabled (HTTPS only for Android P+) – hence android:usesCleartextTraffic="true" working. Some people have URL errors. In my case, filenames with underscores are invalid.

Good luck!

try creating react-native.config.js file with following content module.exports = { dependencies: { ‘react-native-video’: { platforms: { android: { sourceDir: ‘…/node_modules/react-native-video/android-exoplayer’, }, }, }, }, };

@tonyhb That’s pretty slick.

In my case, I am requesting the file from an azure blob and the blob service sends the file over tls. When i passed in the version of azure blob to use all errors where resolved. <VideoPlayer source={{ uri: image, headers: { 'x-ms-version': '2019-02-02', } }} />

same problem as @Shivendra30