Error (1, -2147483648) on Android

Does anyone 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(); 

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> 
+7
source share
3 answers

I got the same error code. In my case, an error occurs because video encoding is not supported by android. Just try to transcode the video.

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

+3
source

I also got the same error on Froyo and Gingerbread. On higher androids, the same video played well. Finally, after a lot of research, I tried changing Https Url to Http Url & Amp; Bingo. He solved my problem. I used the Amazon S3 server to just replace β€œhttps” in the url with β€œhttp” was enough.

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

PS: to support older versions, if you use H.264, make sure the videos are encoded in the baseline.

+3
source

Check out this tutorial on how to use VideoView , which sheds light on your problem.

I think you left a line or two:

 mediaController.setAnchorView(video); video.setMediaController(new MediaController(this)); video.setVideoURI(video); 

Adapt it according to your code, where applicable. The layout may be missing ...

0
source

All Articles