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>
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With