5

I have this video url rtsp://someserver:port/live/001204A006F5.stream and wanted to play the same from android media player. I have written following code snippet but android is showing a dialog box with the msg "Can't play this video".

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);`

    videoPlayer = (VideoView) findViewById(R.id.videoPlayer);   
    videoPlayer.setOnPreparedListener(this);
    videoPlayer.setOnCompletionListener(this);
    videoPlayer.setKeepScreenOn(true);    
    Uri uri = Uri.parse("rtsp://someserver:port/live/001204A006F5.stream");
    videoPlayer.setVideoURI(uri);
}

/** This callback will be invoked when the file is ready to play */
public void onPrepared(MediaPlayer vp) {
    if(videoPlayer.canSeekForward()) videoPlayer.seekTo(videoPlayer.getDuration()/5);
       videoPlayer.start();
}

Am I doing something wrong? Or it is not possible to play that link with VideoView?

Rupesh Sasne
  • 51
  • 1
  • 4
  • check this link it's may help you. [1]: http://stackoverflow.com/questions/11274906/play-rtsp-streaming-in-android-app – Mohit Raval Feb 15 '13 at 10:00
  • I am facing the same issue. It can play a file easily but cannot play live streaming. Vlc does not have any problem in playing it. I checked out the formats, they are also compatible AAC and h264 mpeg4 with android 3.2 – whiteShadow Aug 23 '13 at 08:03
  • Rupesh Sasne have you find some solution to this issue? – androidevil Feb 09 '15 at 12:46

0 Answers0