Can anyone tell me how to use videoview to play mp4 url. I have written the code which is giving me error in my logcat as:
08-05 04:37:35.978: D/MediaPlayer(1693): getMetadata
08-05 04:37:37.918: E/MediaPlayer(1693): error (1, -19)
08-05 04:37:37.928: E/MediaPlayer(1693): Error (1,-19)
08-05 04:37:37.928: D/VideoView(1693): Error: 1,-19
I am using the videoview java code as:
public class VideoPlayerActivity extends Activity {
@SuppressLint("NewApi")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.video_play);
VideoView videoView = (VideoView) findViewById(R.id.videoview_video);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
System.out.println(mediaController);
Uri video = Uri.parse("http://192.168.1.100/Android/jum.mp4");
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
System.out.println("View:"+videoView);
videoView.start();
}
}
I have made the video as H 264 compressed format but also i am not able to watch and listen the video in the android app
Error in the android emulator is as shown below: