The method below plays a video file the on mobile device:
Code:
public void run()
{
try
{
String url = "http://server/video.mpg or video.3gp";
Player p = Manager.createPlayer(url);
p.realize();
//Get the video controller
VideoControl video = (VideoControl) p.getControl("VideoControl");
//Get a GUI to display the video
Item videoItem = (Item)video.initDisplayMode(
VideoControl.USE_GUI_PRIMITIVE, null);
//Append the GUI to a form
videoForm.append(videoItem);
//Start the video
p.start();
}
catch(Exception e)
{}
}
If you want to play the video from an rtsp server, you only need to change url with "rtsp://server/video.mpg or video.3gp".