Figure: MMAPI architecture
Manager
is a class with only static methods; applications
cannot create an instance of it. Manager
provides static
methods for creating players and querying supported protocols and content
types. It also provides a convenient method, playTone
,
for playing a single tone.
Manager
's createPlayer
methods
create a Player
with an associated DataSource
to
supply it with data. This DataSource
can be built from
an InputStream
or from a URI-style locator. The DataSource
instance
is not visible to the application programmer. The Series 40 and Symbian MMAPI
implementation supports, for example, the following locator forms:
http://something.com/somefile.wav
capture://video
(displays video from the device's
built-in camera)
This document will discuss more about locators in the forthcoming chapters. Audio and video recording is discussed in section Recording Sound and Video.
Manager
creates the correct kind of Player
implementation
class by checking the DataSource
's content type (for
example, from an HTTP response's Content-Type header) or file extension. If
it cannot determine the DataSource
's content type, it
will throw a MediaException
Once the player has been created, it can provide you various kinds of Control
,
for instance:
VolumeControl
- to control a player's audio volume
StopTimeControl
- to make a player stop after
playing for a given length of time
VideoControl
- to control how a video player's
image is shown
There are many other types of Control
, but not all
will be supported by a given device's Mobile Media API implementation, or
for a given content type. You can find out what controls are supported in
a device by checking the system properties (for example, System.getProperty("supports.video.capture")
).
A full list of these properties is provided in the Mobile
Media API specification.
For examples on establishing Control
s, see the following
articles at Forum Nokia wiki: