Search code examples
androidstreamingvideo-streamingrtspandroid-video-player

How to play a video from a RTSP link


I want to create an android app which can play video from RTSP link. When i tried to play this through a media player, it showed an error message - "The Video cannot be played" I would be grateful if you can provide me a solution for how to implement this ..

   private String path2 = "rtsp://208.77.20.52:1935/dmm1/setmax";     
   Uri video = Uri.parse(path2);

    mVideoView.setVideoURI(video);
    mVideoView.setMediaController(new MediaController(this));
    mVideoView.requestFocus();
    mVideoView.postInvalidateDelayed(100);
    mVideoView.start();

Solution

  • There is a similar question to yours here: Play RTSP streaming in an Android application

    You might also want to take a look at the Android Developer page for supported media formats here:http://developer.android.com/guide/appendix/media-formats.html

    Without any code I am not sure exactly what you are stuck on. Hope this helps.