Java Reference
In-Depth Information
The MMAPI provides the following classes and interfaces, among others:
•
Manager
: The
Manager
class provides an access point for obtaining system-dependent
resources such as implementations of the
Player
interface.
Manager
methods are
static, so there's no need to obtain an instance of the class.
•
Player
: The
Player
interface provides the methods for interacting with a piece of
multimedia. Subclasses implementing
Player
encapsulate specific rendering
codecs such as an MP3 audio player.
•
Control
: The
Control
interface defines some media processing functions.
Control
implementations interact with objects implementing the
Controllable
interface,
such as
Player
instances to permit programmatic and user control of media. Exam-
ples include the
VolumeControl
, which permits you to adjust the playback volume,
and the
VideoControl
, which permits you to control the visibility and placement of
the video on the display.
•
DataSource
: Implementations of the
DataSource
abstract class provide media to
instances of
Player
. They provide a container indicating a media object's content
type and location as well as streams of source data through instances of
SourceStream
that provide random access to a single media stream.
•
ContentDescriptor
: Instances of the
ContentDescriptor
class bear a string indicating
the type of a specific
DataSource
.
•
TimeBase
: The
TimeBase
interface represents a constantly ticking source of time.
Your application can share one
TimeBase
instance between multiple players to
synchronize multiple streams of media.
•
PlayerListener
: The
PlayerListener
interface describes the asynchronous events a
Player
instance can provide to applications. You can implement this interface to
listen for notifications about media rendering.
•
MediaException
: MMAPI implementations use instances of the
MediaException
class
to signal errors.
■
Note
The
Control
interface has many subinterfaces, and I don't discuss all of them here. For a
thorough explanation of what each does, consult JSR 135 or the Javadoc that accompanies the MMAPI
implementation.