Here is a related thread http://groups.google.com/group/android-developers/browse_thread/thread/0dcefbbd59ac638d
This piece of code works on a HTC device. public class AMLRTSTPStreaming extends Activity implements MediaPlayer.OnPreparedListener, MediaPlayer.OnErrorListener, MediaPlayer.OnCompletionListener{ /** Called when the activity is first created. */ private static VideoView mVideoView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mVideoView = (VideoView) findViewById(R.id.MainVideoView); mVideoView.setVideoURI(Uri.parse("rtsp://video2.americafree.tv/ AFTVHorrorH26496.sdp")); mVideoView.setOnPreparedListener(this); mVideoView.setOnErrorListener(this); mVideoView.setOnCompletionListener(this); mVideoView.setMediaController(new MediaController(this)); mVideoView.requestFocus(); } public void onPrepared(MediaPlayer mp) { mp.start(); } public boolean onError(MediaPlayer mp, int what, int extra) { Toast.makeText(this, "Sorry, can't play video. Error ="+ what, Toast.LENGTH_LONG).show(); return false; } public void onCompletion(MediaPlayer mp) { Toast.makeText(this, "Done. Completed. Finito!", Toast.LENGTH_LONG).show(); } } It works on a HTC device, but not the standard HTC Android 1.5 image. I have a Google ION flashed with the cyanogenmod build. http://forum.xda-developers.com/showthread.php?t=537204 For the Android 1.5 build I have the following errors E/PlayerDriver( 35): Command PLAYER_INIT completed with an error or info PVMFFailure E/MediaPlayer( 538): error (1, -1) E/MediaPlayer( 538): Error (1,-1) D/VideoView( 538): Error: 1,-1 Does this help :) ? Balwinder Kaur Open Source Development Center ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Sep 16, 9:02 am, yjshi <shiyaju...@gmail.com> wrote: > Have anyone used mediaplayer to run rtsp streaming successfully either > on the emulator or on the HTC device? > Could anyone give me an example to play the rtsp streaming > successfully? > I tried it too many times ,but always failed. > Could anyone tell me some suggestions? Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---