I am trying to play RTSP (from rtsp://media2.tripsmarter.com/LiveTV/BTV/) real-time video using VideoView, and here is my code:
public class ViewTheVideo extends Activity {
VideoView vv;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
vv = (VideoView) this.findViewById(R.id.VideoView);
Uri videoUri = Uri.parse("rtsp://media2.tripsmarter.com/LiveTV/BTV/");
vv.setMediaController(new MediaController(this));
vv.setVideoURI(videoUri);
vv.requestFocus();
vv.setOnPreparedListener(new OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
vv.start();
}
});
}
}
This code works great on the Samsung Galaxy Y and even on the emulator, but it doesnโt work on the Samsung Galaxy S2 (sorry, this video cannot be played)! Both devices and the emulator work with Gingerbread.
Here are the logcat messages:
07-30 10:48:28.310: I/MediaPlayer(24573): uri is:rtsp://media2.tripsmarter.com/LiveTV/BTV/
07-30 10:48:28.310: I/MediaPlayer(24573): path is null
07-30 10:48:28.310: D/MediaPlayer(24573): Couldn't open file on client side, trying server side
07-30 10:49:13.025: W/MediaPlayer(24573): info/warning (1, 26)
07-30 10:49:13.025: I/MediaPlayer(24573): Info (1,26)
07-30 10:49:13.075: E/MediaPlayer(24573): error (1, -1)
07-30 10:49:13.075: E/MediaPlayer(24573): Error (1,-1)
07-30 10:49:13.075: D/VideoView(24573): Error: 1,-1
I could not understand what error codes are.
Are there any problems with the Samsung Galaxy S2 with streaming? I also tried using the YouTube stream ( rtsp://v2.cache2.c.youtube.com/CjgLENy73wIaLwm3JbT_9HqWohMYESARFEIJbXYtZ29vZ2xlSARSB3Jlc3VsdHNg_vSmsbeSyd5JDA==/0/0/0/video.3gp), but anyway.
Update:
Galaxy S2 (: 3GP, Encoder: H.264, Bitrate: 56kbps, Framerate: 15 ) VLC. Galaxy S2 ( ) - . S2.