Playing Video

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()
String url = "http://server/video-mpeg.mpg";
Player p = Manager.createPlayer(url);

//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

//Start the video
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.


  1. First of all , would like to say..nice work done !!!

    but what to do read vedio files from mobile's memory and then play them ?

  2. Hello,

    i 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.......

    or if you want you can mail me that too...

  3. nice code! but please tl me how shud i link the vedio file on the select of a button from the menu

  4. Really nice code..
    But if i wanted to play last N number of seconds video from video file, then how to reduce the size of video.

  5. What about the asterisk streaming?

  6. how to get a video file from a tomcat server and making it to run in a mobile application

  7. how to get a video like an image in j2me

  8. how to implement ticker with j2me..

  9. hahaha 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.
    Nice post.

  10. I just like your program ,were is the image result your program

  11. I'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.

  12. hiii, i want to play shout cast streaming radio on MIDP any help...thanks in advance



Design by Blogger Buster | Distributed by Blogging Tips