I use the code below to play an MP4 video (H.264, AAC codecs) from a URL (The url is perfectly fine, no redirect, 404 or anything). However, I keep getting the errors "attempt to call getduration without a valid mediaplayer" or ERROR/MediaPlayer(382): error (1, -2147483648). Does anyone have any idea how to fix it? Thanks
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();