Java Reference
In-Depth Information
(Item) mVideoItem = (Item) mVideoControl.initDisplayMode(
VideoControl.USE_GUI_PRIMITIVE, null);
mForm.append(mVideoItem);
The resulting Item can be immediately added to a form. Figure 16-5 shows VideoMIDlet
running on the WTK emulator.
Figure 16-5. Playing video with MMAPI
Tip The most common video content type supported by MMAPI is “video/mpeg” or MPEG-1 video. This is
often called the VideoCD (VCD) format. It is the predecessor of MPEG-2, which is used in today's DVD products.
While lower in resolution, MPEG-1 is more than adequate for the screen size found in today's mobile device.
You can convert your video to MPEG-1 format easily using a variety of tools. An excellent free one can be
found here: http://www.tmpgenc.net/ .
Listing 16-5. Playing Video Using MMAPI
import java.io.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.media.*;
import javax.microedition.media.control.*;
 
Search WWH ::




Custom Search