How to play RTSP [live streaming] link in android?
I am trying to play the RTSP live streaming url "rtsp: //164.100.51.207/broadcast/DDLive". But I am getting this error (1, -1).
I am trying to use this code
VideoView myVideoView = (VideoView) findViewById(R.id.videoPlayer);
myVideoView.setVideoURI(Uri.parse(url.toString()));
myVideoView.setMediaController(new MediaController(this));
myVideoView.requestFocus();
myVideoView.start();
this code gives error (1, -1). I cannot play this link. If anyone can tell me to play this url.
thinks.
source to share
Carousel offer -
- download the rtsp stream to a local file using VLC which has just been compiled on android.
- Once the download is complete, just play that file using the usual local file intent and mp4 mimetype.
The snip below should play the downloaded files.
new Intent(Intent.ACTION_VIEW).setDataAndType(Uri.parse("file:///mnt/sdcard/myfile.mp4"), "video/mp4");
VLC on android links: http://forum.xda-developers.com/showthread.php?t=1517415 http://code.google.com/p/android-vlc-remote/source/browse/AndroidManifest.xml
Getting rtsp link from any youtube video is a slightly involved process
You can stream almost any YouTube video as RTSP if you do the following:
- Get youtube video id - for example videoID = kgfctMNeDtg
- Get youtube feed for videoID
- Find the rtsp url for the corresponding youtube format. 1.5 6 formats all have rtsp
- request rtsp uri with HttpClient instance
More details:
http://snipplr.com/view/63341/youtube-rtsp-cli-request--audio-track-only-p2/
http://snipplr.com/view/57846/curl--rtsp-to-get-sdp-descriptor-for-media-stream/
source to share