Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error (1, -2147483648) on Android

Tags:

android

Does anybody know the meaning of this error?

 VideoView video = (VideoView) findViewById(R.id.myvideo);    
 Intent videoint=getIntent();    
 String url =  videoint.getStringExtra("url"); //The url pointing to the mp4     
 video.setVideoPath(url);     
 video.requestFocus();     
 video.setMediaController(new MediaController(this));     
 video.start();

The manifest permissions:

<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"></uses-permission>
like image 416
trivektor Avatar asked Apr 19 '11 02:04

trivektor


2 Answers

I got the same error code. In my case the error is generated because the video encoding is not supported by android. Just try to re-encode your video.

this page should help: http://developer.android.com/guide/appendix/media-formats.html

like image 109
sebataz Avatar answered Oct 06 '22 20:10

sebataz


I was also getting the same error on Froyo & Gingerbread. In higher Androids the same video played well. Finally after a lot of research, tried changing the Https Url to Http Url & Bingo. It resolved my issue. I was using amazon S3 server so that simply replacing the "https" in url with "http" was sufficient.

  videoUrl= videoUrl.replaceFirst("https", "http"); 

PS: For supporting older versions if you are using H.264 make sure videos are Baseline encoded.

like image 36
Ajith Memana Avatar answered Oct 06 '22 20:10

Ajith Memana