Would you like to tell us how we are doing?

You bet No thanks

Sorry about the red box, but we really need you to update your browser. Read this excellent article if you're wondering why we are no longer supporting this browser version. Go to Browse Happy for browser suggestions and how to update.

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.
catch (Exception me)
    // Insert code that runs if the video stream is not available.