Java Reference
In-Depth Information
The MMAPI is very modular; to meet the goal of being available on the widest variety
of platforms, not all features are available in all implementations. You can get a list of
supported content types by invoking Manager.getSupportedContentTypes , or you can get a
list of the supported protocols for each content type by passing a supported content type
to Manager.getSupportedProtocols . Listing 16-5 enumerates the supported types and pro-
tocols on a given device, writing each to the debug console.
Listing 16-5. Enumerating Supported Media and Protocol Types
private void showSupportedMedia() {
String[] contentTypes = Manager.getSupportedContentTypes(null);
for (int i=0; i<contentTypes.length; i++) {
String protocols[] = Manager.getSupportedProtocols(contentTypes[i]);
for (int j=0; j<protocols.length; j++) {
String s = contentTypes[i] + ":" + protocols[j];
System.out.println(s);
}
}
}
In addition to determining whether a given MMAPI implementation supports a specific
content type or protocol, you may need other information, such as whether the target device
supports playing multiple audio channels simultaneously (audio mixing), whether the plat-
form can capture audio or video, and so forth. The MMAPI defines a set of system properties
whose values you can obtain using System.getProperty ; these are shown in Table 16-2.
Table 16-2. Properties Describing a Target Device's MMAPI Implementation
Property
Returned Value
microedition.media.version
The version of the MMAPI specification implemented
supports.mixing
true if the device supports mixing; false otherwise
supports.audio.capture
true if the device supports audio capture; false otherwise
supports.video.capture
true if the device supports video capture; false otherwise
supports.recording
true if at least one returned Player type supports recording;
false otherwise
audio.encodings
A string specifying the supported capture audio formats
video.encodings
A string specifying the supported capture video formats
video.snapshot.encodings
A string specifying the supported video snapshot formats for
VideoControl.getSnapshot
streamable.contents
A string specifying content types that can be played by a
Player instance as it receives data
 
Search WWH ::




Custom Search