android radio,rtsp streaming,setDataSource(rtsp URL)

All your problems with Audio, Video and Images.

android radio,rtsp streaming,setDataSource(rtsp URL)

Postby ArthurWu » Thu Jun 11, 2009 7:19 am

I am trying to read rtsp radio streaming from network because i am trying to make a radio software in Android.And it's have been talked a lot before.Now android 1.5 released,and it seems rtsp is supported.
the method setDataSource in MediaPlayer class :
void setDataSource(String path)
Sets the data source (file-path or http/rtsp URL) to use.
How to use the method to read rtsp?

MediaPlayer mp =new MediaPlayer();
try {
mp.setDataSource("rtsp://live.cri.cn/pop");
mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
mp.prepare();
mp.start();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

this is not working.

mp.setAudioStramType(parameter);I don't know to use which parameter.
and rtsp://live.cri.cn/pop is a online radio streaming.
Who know how to receive and play the streaming.Or rtsp is still can't be supported in android 1.5???

I know there's a android radio software,can be download from
http://www.androidhere.cn/plus/download ... Q0MjYucmFy
who knows how to realize?
Please help me .Thank you.
ArthurWu
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Nov 25, 2008 9:35 am

Top

Postby aor.leadapps » Mon Jun 22, 2009 2:02 pm

create a OnPreparedListener()
and Call Start() in OnPrepareCompleted() { player.start()}
however I found the link you are trying is not a rtsp...

may be u can install local darwin streaming server and use that rtsp:// ur local link...

remember audio: amr, aac ; video: h2.64, h263 are supportedformats..
aac; h264; h263
however profiles varies...

good luck..

aor.leadapps -
aor.leadapps
Freshman
Freshman
 
Posts: 2
Joined: Mon Jun 22, 2009 1:56 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Google Feedfetcher and 14 guests