The Mobile Media (JSR-135) API enables simple access and control of basic audio and multimedia resources but also addresses scalability and support for more sophisticated features. In short, it allows you to display images and play video/audio and audio clips in Java applications.
The Mobile Media API is supported as specified in the JSR-135 specification. The Mobile Media API implementation supports:
QVGA and VGA resolution
Audio mixing
Audio progressive recording (or audio stream sending while recording)
FramePositioningControl
Tone generation
Sampled audio playback
MIDI playback and interactive MIDI programming
Video Playback
Audio capture
Still image capture
Image format playback (for example, PNG and GIF)
Video capture
Video playback
Video and image progressive playback
Video scaling
Video metadata
Video rate control
Video frame positioning control
Metadata support for ID3v2 fields provided by Winamp, MP4 and WMA
Music progressive playback
RTSP streaming
DRM-protected contents
Audio mixing
Media time
Media key
The following features are excluded from the Mobile Media API:
Music metadata through progressive playback
Progressive upload
RateControl
MidiControl
StopTimeControl
MIDI bank queries
Interactive MIDI playing
Media Keys
The following features are introduced from the Mobile Media API:
https:// URI locator
The following features are excluded from the Mobile Media API:
Audio mixing (that is, playing two audio files such as mp3 or wma simultaneously)
The following features are now supported by the Mobile Media API:
FramePositioningControl
The following example code demonstrates how to use FramePositioningControl:
Player player = Manager.createPlayer(“file:///MemoryCard/test.3gp”); player.realize(); player.prefetch(); FramePositioningControl fc = (FramePositioningControl?)Player.getControl(“FramePositioningControl”); int lastFrame = fc.mapTimeToFrame(Integer.MAX); int realFrames = fc.seek(100); int realSkipped = fc.skip(50); int time = fc.mapFrameToTime(50);
Audio progressive recording (or audio stream sending while recording)
Audio mixing which allows the audio to play simultaneously. You can now query the JSR-135 system property "supports.mixing" to know whether it supports audio mixing. If the returned value is true, players can work with mixing effect.
QVGA and VGA resolution, which enables the use of the parameters “width” and “height” to change the resolution. For more information about using this feature, see Taking photos. Now, we can use the following parameters:
getSnapshot(“encoding=image/jpeg&width=640&height=480”) getSnapshot(“encoding=image/jpg&width=320&height=240&quality=75”) getSnapshot(“width=640&height=480”)