Java Reference
In-Depth Information
Interface
Purpose
Example Methods
StopTimeControl
getStopTime
setStopTime
Set a preset stop time
TempoControl
getTempo
setTempo
Change tempo in synthesized audio
ToneControl
setSequence
Replay monochannel tone sequence
VideoControl
getSnapshot
setDisplayFullScreen
setDisplayLocation
setDisplaySize
setVisible
Control video display
The GUIControl and its subinterface VideoControl deserve special attention, because
they're how you get the video data from a multimedia source like a file or the device
camera and display it on the screen. The GUIControl interface specifies a single
method— initDisplayMode —which you use to obtain an object that can draw on a
Displayable object. VideoControl extends this interface, providing you with methods to
display video full-screen, specify the location of video playback, and so forth. Listing
16-6 shows how you use a VideoControl instance in conjunction with a Player instance
to play a video clip.
Listing 16-6. Playing a Video Using VideoControl and Player Instances
Player player;
Form viewer;
VideoControl vc;
try {
InputStream in = getClass().getResourceAsStream("/res/video.3g2");
player = Manager.createPlayer(in, null);
vc = (VideoControl) player.getControl("VideoControl");
player.realize();
player.prefetch();
if (vc != null) {
Item vi = (Item) vc.initDisplayMode(
VideoControl.USE_GUI_PRIMITIVE, null);
viewer.append(vi);
}
player.start();
} catch (MediaException e) {}
catch (IOException e) {}
 
Search WWH ::




Custom Search