MMAPI(Mobile Media API) provides a framework for playing media content on J2ME devices.There are protocols defined for real-time streaming of Internet radio content, streaming other RTP (Real-time Transport Protocol) content, capturing audio, and taking pictures.
The method below plays a video file the on mobile device:
public void run()
{
try
{
String url = "http://server/video-mpeg.mpg";
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". This will only work on devices which support real time input streams.
First of all , would like to say..nice work done !!!
ReplyDeletebut what to do ...to read vedio files from mobile's memory and then play them ?
Hello,
ReplyDeletei wanted an running and simple example for playing a video from a local file system....not from server...........i did find many different codes from different webpages.......but none of them came along good........none of them worked for me.
i have also gone through the MMAPI example which is there in the WTK package.....but that was also complicated.......
thanks......
or if you want you can mail me that too...
hiteshrawat@gmail.com
nice code! but please tl me how shud i link the vedio file on the select of a button from the menu
ReplyDeleteReally nice code..
ReplyDeleteBut if i wanted to play last N number of seconds video from video file, then how to reduce the size of video.
What about the asterisk streaming?
ReplyDeletedfg
ReplyDeletehow to get a video file from a tomcat server and making it to run in a mobile application
ReplyDeletehow to get a video like an image in j2me
ReplyDeletehow to implement ticker with j2me..
ReplyDeletehahaha funny this is like a pirate code for crack windows vista haha thanks for sharing you just give an idea for the windows media player.
ReplyDeleteNice post.
I just like your program ,were is the image result your program
ReplyDeleteI'm so glad to find your blog, even though I did it by a fluke. The information posted here is interesting and entertaining. In short, a really nice blog.
ReplyDeletehiii, i want to play shout cast streaming radio on MIDP any help...thanks in advance
ReplyDelete