MMADemo Application and MediaControlSkin

Java™ 2 Platform, Micro Edition, Wireless Toolkit
Version 2.1

December  2003

 

About the mmademo and the MediaControlSkin

Of the multimedia demo applications provided, the Simple Player and Video applications demonstrate the full extent of the MMAPI features. This appendix describes these two demo applications and the MediaControlSkin provided by the J2METM Wireless Toolkit that contains audio and playback controls to use on the mmademo demo programs.

Simple Player

The SimplePlayer demo application demonstrates the range of audio and video capabilities of the MMAPI. Simple Player consists of an HTTP and Record Management System (RMS) directory browser, a player, and a customized ring tone parser.

The HTTP browser lets you browse HTTP directories. To make SimplePlayer's browser treat the URL as a directory, you need to include a slash at the end of the URL address. Selecting a media file opens it in SimplePlayer. You can also download HTTP files and save them to an storage directory of your choosing.

The player portion uses a generic javax.microedition.media.Player interface. The player displays duration, media time, and controls for running the media file. If metadata is available in a file, the player enables you to view the information, such as author and title. In the case of MIDI files, if karaoke text is present in the file, it displays on the screen during play. Graphical user interface controls can be viewed on the display screen if applicable. You can access these controls, by selecting one of the media samples in SimplePlayer, then pressing the Menu button to view and select the desired command.

In addition, SimplePlayer parses ring tones in Ringing Tones text transfer language (RTTTL). See http://www.convertyourtone.com/rtttl.html for information on RTTTL.

For a list of MMAPI-specific audio and video controls available on the emulator's keypad, see TABLE 4.

The demo includes the following media samples:

A key feature of SimplePlayer is the implementation of keypad functions for non-video media. The following table shows which controls are available in the SimplePlay for various media types (WAV, MIDI, or MPEG-1 files).

Go to http://java.sun.com/products/mmapi/index.html to see how these controls are implemented by examining the classes associated with the controls in the Mobile Media API.

TABLE 1. Audio and Video Controls for SimplePlayer Applications
Keypad Commands Video WAV
PCM
MIDI/
Ring Tone
Class
Mute/Unmute Sometimes Always Always VolumeControl
Volume Sometimes Always Always VolumeControl
META data Sometimes Sometimes Sometimes MetaDataControl
Stop in 5 seconds Always Always Always StopTimeControl/td>
Rate Always Never Always RateControl
Tempo Never Never Always TempoControl
Pitch Never Never Always PitchControl
Start/Stop Recording Never Always Never RecordControl
Full Screen Always Never Never VideoControl
Frame Forward/Backward Always Never Never FramePositioningControl
Play/Stop Always Always Always Player
Loopmode Always Always Always Player
Skip Forward/Backward Always Always Always Player
Rewind Always Always Always Player

The following table defines the menu commands available with the SimplePlayer demo:

TABLE 2. SimplePlayer Menu Commands
Commands Definitions
Mute Turns off sound but the file continues to execute. This command toggles to Unmute.
Volume Increases or decreases loudness.
META Data Displays information provided by the media file such as, copyright information, the title of the audio piece, and a track list.
Stop in 5 seconds Pauses the audio play in five seconds when set during execution.
Rate Alters the rate of speed of playback.
Tempo

Increases or decreases the tempo of the tone sequence or MIDI file.
Pitch Lowers or raises the notes in a MIDI file.
Start/Stop Recording Records the audio playback. A file is created containing the recorded audio in the directory in which the emulator is running. If you do not specify a filename, a file called recording.wav is created. This command toggles to Stop Recording.
Full Screen Displays a video in the full screen display area.
Frame Forward/Backward Jumps forward or backward one frame at a time in a video file.
Play/Stop Starts or stops the program.
Loopmode

Plays back the audio file immediately after completion of play. Running Loopmode once plays the audio file once. Pressing a second time plays the file three times. Pressing a third time plays the file repeatedly. Pressing a fourth time returns to single play.

Skip Forward/Back

Skips forward or backward five percent of the duration of the media file. The sound track syncs to the video.

Rewind Returns to the start time of the audio playback.

Video

The Video demo application shows a stream of random scenes with background music demonstrating the synchronization of both an audio player and a video player. The Video demo can be viewed in a Form or Canvas. Choosing the Form option runs the video in the screen display area. Choosing the Canvas option runs the video in a canvas in the screen display area. Both versions of the Video demo are accessed through an internet connection. If you are running the Video demo from behind a firewall, remember to set your proxy server and port.

When you choose the Form option, information about the video is shown above the video display. The information given includes the current status of the video (Playing or Paused), the rate of play, the volume level of the audio being played, and the frame position.

Notice that when running the Video demo, one of the soft buttons is labeled Snapshot. Pressing this button while the video is running, captures a frame of the video at the instant the button is pressed. If you are running Video with the Canvas option, the snapshot momentarily replaces the video in the screen display area. If you are running Video with the Form option, the snapshot is placed immediately below the video. Successive snapshots are stacked in order below the first snapshot.

MMAPI Supported Formats

MMAPI supported formats in the J2ME Wirless Toolkit are:

Limitations on Using the MMAPI in the Wireless Toolkit

Attributes for mmademo

The mmademo applications has the following attributes that you can modify in the User Defined panel of the Project Settings dialog box:

TABLE 3. Descriptions of MMAPI-specific MIDlet Attributes
Attribute Description Attribute File
Player-<n> Name of the nth media title to be played back by the SimplePlayer MIDlet. JAD
PlayerURL-<n> Location of the nth media title, playerTitle-<n> to be played back by the SimplePlayer MIDlet. JAD
VideoTest-<n> The name of the nth media title to be played back by the VideoTest MIDlet. JAD
VideoTest>-URL<n> Location of the nth media title, playerTitle-<n> to be played back by the VideoTest MIDlet. JAD

MediaControlSkin

A special skin is provided by the Wireless Toolkit that contains audio and video playback controls that you can use to modify and test the features in the mmademo. Playback control buttons for sound and video are described in the following table:

Table 4. Audio and Video Playback Controls on MediaControlSkin Keypad
Keypad Buttons Function
1/Reverse Stops video and reverses approximately 10% and resumes play.
2/Play-Pause Press once to pause video, press again to resume play.
3/Forward Stops video and advances approximately 10% and resumes play.
4/Slow Slows play of video incrementally as you hold button down.
5/Stop Stops video playback.
6/Speed Up Increase speed of video play incrementally as you hold button down.
7/Go Back Goes back one frame during play.
8/Full Screen Toggles to fill entire display area or reduce area of video display. Note that switching screen size modes causes flashing.
9/Go Forward Advances video one frame during play.
*/Decrease Volume Lowers audio volume.
0/>Mute Mutes audio.
#/Increase Volume Increases audio volume.

Buttons are active relative to the type of application running. For instance, if a .wav file is running, the buttons controlling video are inactive. Similarly, the soft button labels are relative to the type of application running. For instance, if a video is running, the label Snapshot is displayed. Snapshot captures a frame in the video at the instant the button is depressed. Note that buttons implemented for video media might be implemented by a user program such as MediaPlayer.

The MediaControlSkin device, contains the following features: