hi,

We have successfully played rtsp://ip:port/3gp file or
rtsp://ip:port/mp4file.... rtsp://ip:port/sdp file link...
no problem at all...

There is bug in u r code:

wrong code:
 mp.prepare();
  mp.start();

CORRECT CODE:
call mp.start() , OnPrepareComplted() { mp.start()}

thx
aor.leadapps


On Thu, Jun 11, 2009 at 12:13 PM, [email protected] <
[email protected]> wrote:

>
> To read rtsp streaming has been discussed a lot,but still not
> solved .Now android 1.5 realised,can rtsp streaming be played in
> android?
> the method setDateSource seems provide a way to receive rtsp
> streaming.
>
> public void setDataSource (String path)
>
> Sets the data source (file-path or http/rtsp URL) to use.
> Parameters
> path    the path of the file, or the http/rtsp URL of the stream you want
> to play
> Throws
> IllegalStateException   if it is called in an invalid state
> IOException
> IllegalArgumentException
>
> who knows how to use it?i wrote
>
> 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();
>                }
>
> but didn't work.May be the parameter in setAudioStreamType is
> wrong....Who knows??please help me .Thank you.~~
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to