Java Reference
In-Depth Information
Listing 16-16 shows the entire MultimediaMIDlet class, which provides the entire
implementation. As a MIDlet, its target is of course the MIDP; you could write similar
code using the MMAPI and the SVGAPI to run on a CDC platform that included these
APIs in addition to AWT or Swing.
Listing 16-16. The MultimediaMIDlet Class
package com.apress.rischpater.multimediamidlet;
import java.io.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.media.*;
import javax.microedition.media.control.*;
import javax.microedition.m2g.*;
public class MultimediaMIDlet
extends MIDlet
implements CommandListener, Runnable {
private Display display;
private List choiceScreen;
private Form mediaScreen;
Displayable viewerDisplayable;
private Item videoItem;
private ImageItem capturedImage;
private VideoControl videoControl;
private Command captureCommand;
private Command selectCommand;
String mediaName = null;
String mediaType = null;
private Player player = null;
SVGAnimator svgAnimator;
boolean endNow;
private static final String SVG_IMAGE_PATH = "/res/image.svg";
private static final String SVG_IMAGE_TYPE = "image/svg+xml";
private static final String WAV_SOUND_PATH = "/res/sound.wav";
private static final String WAV_SOUND_TYPE = "audio/x-wav";
private static final String MPG_MOVIE_PATH = "/res/movie.mpg";
private static final String MPG_MOVIE_TYPE = "video/mpeg";
private static final String CAP_VIDEO_PATH = "capture://video";
private static final String CAP_VIDEO_TYPE = "video/x-capture";
 
Search WWH ::




Custom Search