Switching media feeds when using the RTSP protocol
When you use the RTSP protocol to stream audio or video, you can switch feeds without disconnecting and reconnecting to the server (if supported by the server). This ability results in faster and more efficient content switching, for example, when changing channels in a mobile TV application. The net.rim.device.api.media.control.RtspContentControl interface provides the method that you can use to switch media feeds.
To obtain an RtspContentControl object, invoke javax.microedition.media.Player.getControl() on a Player object that you created to play RTSP media.
When you invoke getControl(), you must pass in the fully qualified class name of the control (for example "net.rim.device.api.media.control.RtspContentControl").
To switch media streams, invoke switchStreamToUrl() on the RtspContentControl object and pass in the URL of the media source that you want to switch to.
RtspContentControl rtspControl = (RtspContentControl) player.getControl( "net.rim.device.api.media.control.RtspContentControl"); if (rtspControl == null) { // Insert code that runs if an RtspContentControl object is not available. } try { rtspControl.switchStreamToUrl("<URL>"); } catch (Exception me) { // Insert code that runs if the video stream is not available. }