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
.
DRM MIDI loads a DRM-protected MIDI
file. Selecting this options opens the DRMPlayer
.
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.
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 DRM MIDI from the MediaList
, the DRMPlayer
is launched. On launch, the MediaFactory.getAppProperty
method retrieves the value of the custom-defined DRM-Audio-Clip
JAD attribute, and uses the value as the path from which the player
attempts the playback. In this example, the JAD attribute has the
value file:///D:/predefgallery/predeftones/song.mid.dcf
.
To ensure that the MIDlet works correctly, you must either
move the MIDI file from the drm
folder of the MIDlet project to the location defined in the JAD attribute, or change the JAD
attribute to point to the location where the MIDI file is stored (for
example, the memory card).
Note: DRM-protected content parsing is supported only from S60 3rd Edition onwards. DRM-protected files can be played from a file location, not from the JAR archive.
Note: The playback of DRM-protected media can fail if the device does not have the rights to play the protected content.
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.