The main screen of the application is a list (a MediaList
) that shows the available MMAPI examples:
Figure: MediaList in the Media Sampler MIDlet
The MediaList
contains the following options:
Play audio allows the user to play audio
with cached players. Selecting this option opens the AudioCanvas
.
Play video allows the user to select
a video source and then play the video. Selecting this option opens
the VideoSourceSelector
.
Check MMAPI support displays MMAPI-specific
device properties. Selecting this options opens the SupportForm
.
When the user selects Play audio from the MediaList
, the AudioCanvas
is set to visible:
Figure: AudioCanvas
The AudioCanvas
allows the user to play
sounds that are mapped to the numeric keys on the device keypad. All
sounds that are supported by the device are displayed on the canvas
below the "Sound key mapping" text. The file path in the JAR file
and the MIME type of the media are displayed after the numeric key
to which the sound is mapped. The user plays the sound by pressing
the numeric key to which the sound is mapped. On touch-enabled devices,
the user can also tap the text elements on the canvas to play related
sounds or to change volume levels.
The AudioCanvas
provides two navigation options:
Info allows the user to view extra information
about sounds that are not supported by the device (see the following
figure). The user can also view information about whether the MIDlet
was able to create multiple media player instances and cache them.
To return to the AudioCanvas
from the Info view, select Back.
Back returns the user to the MediaList
.
Figure: Info view of AudioCanvas
When the user selects Play video from the MediaList
, the VideoSourceSelector
is set
to visible. The VideoSourceSelector
presents a list
from which the user can select a video source:
Figure: VideoSourceSelector
The VideoSourceSelector
provides the following
options:
From http opens an input field where the user can enter the HTTP URL of the video.
From jar loads a video file included in the MIDlet JAR file.
In both cases, the video is rendered on the VideoCanvas
.
The VideoCanvas
displays the video selected in
the VideoSourceSelector
.
Playback starts automatically
when the VideoCanvas
is shown and the device is ready
to render the video. The user can stop playback by selecting the Stop command while the video is playing. The user can
restart a stopped video or resume a paused video by selecting the Replay command.
When the user selects Check MMAPI support from the MediaList
, the SupportForm
is set to visible, displaying MMAPI-specific information retrieved
from the device:
Figure: SupportForm
For information about implementing the MIDlet, see section Implementation.