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...
Video loads and plays
Which player are you experiencing the problem on:
I've got exactly the same problem
I haven't seen that error before.
Have you tried ExoPlayer? It may be more compatible and probably will give somewhat better error info.
Post a link and I'll try and look at the video at some point.
@cobarx I have tried exoPlayer and with it I am not able to play any video, it automatically crashes
That is very strange. It should play mp4s without any problems. Can you
send over a stack trace so we can figure out what's going on?
On Fri, Aug 17, 2018, 10:09 AM Federico Gonzalez notifications@github.com
wrote:
@cobarx https://github.com/cobarx I have tried exoPlayer and with it I
am not able to play any video, it automatically crashes—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/react-native-community/react-native-video/issues/1186#issuecomment-413930097,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AD4AF3lB0c-WDRABfN8wcL15tUBY-YHQks5uRvjngaJpZM4V88pV
.
@thetrevlore Have you found a way of fixing the problem?
getting this same issue same error message. I'm loading an mp4 asset locally from an assets folder in my react native src folder. On initial app launch the video plays just fine when I come back to that screen after some time I get a black screen. Android details:
buildToolsVersion = "27.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
I'm on React Native 57, using an actual device Galaxy S9
I used to run into stucked black screen all the time. The most strange one I experience is https://github.com/react-native-community/react-native-video/issues/1538
My feeling is this project manage the native video player instances very poorly (especially on Android). The project frequently mess things up when you have multiple native video player instances. In our project, we had to do a lot of difficult and hard things to ensure that we only have one instance of a screen that have the
I am getting this {extra: -2147483648, what: 1}.
It's a very random behavior though
same problem as @Shivendra30
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!
@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',
}
}}
/>
Hello, if ever it can be useful... I found that if the component was used several times (several screens for example) you just had to hide it (as for example with this.state.showVideo) before going to the next screen to fix the problem you are talking about.
In my scenario, the download was corrupt in random cases, so I give 3 attempts of download before give up, something like this:
class VideoComponent extends React.Component {
constructor(props) {
super(props);
this.downloadAttempts = 3;
this.state = {
error: '',
};
}
onError = async () => {
if (this.downloadAttempts > 0) {
this.downloadAttempts--;
try {
await CacheService.remove(this.props.uri);
} catch (error) {}
await CacheService.download(this.props.uri);
} else {
this.setState({ error: 'Error :(' });
}
}
render() {
if (this.state.error) {
<Text>{error}</Text>
}
return (
<Video
source={{ uri: this.props.uri }}
onError={this.onError}
/>
)
}
}
I'm getting error: {"error": {"extra": 0, "what": -38}}
@marexv Where are you requesting the file from?
@PosSoolutions AWS S3. I have two videos loaded on a test bucket. One will work, the other one will throw this error. _ or - are not the issue because http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4 will work.
During my struggles with this I found the answer researching the TLS
version that azure was using. Now if you have both mp4 in the same exact
environment and only one of them works then i would start to look at
file corruption or play around with the name of the file. Any spaces in the
file name cause problems for IOS.
On Sat, Jan 4, 2020 at 4:34 PM Marko Prcać notifications@github.com wrote:
@PosSoolutions https://github.com/PosSoolutions AWS S3. I have two
videos loaded on a test bucket. One will work, the other one will throw
this error. _ or - are not the issue because
http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4 will work.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/react-native-community/react-native-video/issues/1186?email_source=notifications&email_token=AHT3QHC4SERRVWMWAOSIHZDQ4ETH3A5CNFSM4FPTZJK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIDDPHQ#issuecomment-570832798,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHT3QHHM6F3H5SXDZ5F5QQTQ4ETH3ANCNFSM4FPTZJKQ
.
@PosSoolutions I will first check if size is the issue. Video that's failing is 1080p while working one is 540, next thing will be corruption (both videos will play in browser, but i'm suspecting that failing video might be corrupted because it won't work when I tried to play it with google drive's player => basically youtube)
EDIT 1:
Inital result: Downsizing video from 90MB to 9MB made it work.
EDIT2:
Size is not the problem, but videos. Videos I'm trying to play are made using Adobe premier (h.264/mp4). When I run them through online converter (i.e. https://www.online-convert.com) they work.
Please use exoPlayer fro android to resolve this issue. Force your app to use exoPlayer by adding
following lines in settings.gradle
include ':react-native-video' project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
This solution works for me
https://github.com/react-native-community/react-native-video/issues/1894#issuecomment-584832293
Note that it wasn't work for me when I added this lines to settings.gradle to force exoPlayer
include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
Most helpful comment
I am getting this
{extra: -2147483648, what: 1}.It's a very random behavior though