|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.plazmic.mediaengine.MediaPlayer
A core class of the MediaEngine API that provides all necessary methods for the playback of the media types supported by the Media Engine.
MediaPlayer functions in the following states: UNREALIZED, REALIZED, and STARTED.
The default state is UNREALIZED. In this state MediaPlayer requires minimum
resources. A MediaPlayer enters REALIZED state when the media is ready for
playback by calling setMedia().
The transition from UNREALIZED to REALIZED might take a long time as
MediaPlayer loads the media and allocates all required resources.
MediaPlayer moves from the REALIZED state to STARTED by calling start().
From the STARTED state it can enter REALIZED state by calling stop() or
setMedia(). MediaPlayer can enter UNREALIZED state once again on close().
MediaManager| Field Summary | ||
static String |
ID
Identifier of the player used when calling MediaServices#getService |
|
static int |
REALIZED
Represents the REALIZED state. |
|
static int |
STARTED
Represents the STARTED state. |
|
static int |
UNREALIZED
Represents the UNREALIZED state. |
|
| Constructor Summary | ||
MediaPlayer()
The default constructor. |
||
| Method Summary | ||
void |
addMediaListener(MediaListener l)
Registers a listener with the MediaPlayer. |
|
void |
close()
Closes an instance of MediaPlayer. |
|
Object |
getMedia()
Returns current media object. |
|
long |
getMediaTime()
Returns the current media time. |
|
int |
getState()
Returns the current state. |
|
Object |
getUI()
Returns platform specific UI component into which the media will be loaded. |
|
void |
removeMediaListener(MediaListener l)
Unregisters a listener from the MediaPlayer. |
|
void |
setMedia(Object media)
Sets the already constructed media for the playback. |
|
void |
setMediaTime(long time)
Sets the media time starting from 0. |
|
void |
start()
Starts playback of the media content. |
|
void |
stop()
Stops playback of the media. |
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String ID
MediaServices#getService| Constructor Detail |
| Method Detail |
public int getState()
One of UNREALIZED, REALIZED, STARTED.
public void start()
throws MediaException
MediaException - Thrown if MediaPlayer is in the UNREALIZED
state or if no media content exists.public void stop()
MediaPlayer enters the REALIZED state when this method is called.
public void setMediaTime(long time)
throws MediaException
time - The specified time for which to set the media player.MediaException - Thrown if the media type is not supportedpublic long getMediaTime()
public Object getMedia()
public void setMedia(Object media) throws MediaException
The media object is created by calling the getMedia() method.
media - The media object to be set.MediaException - Thrown if the media type is not supported.IllegalArgumentException - Thrown if media object is not compatible with the playerpublic Object getUI()
This UI object does not provide any additional public interface.
public void close()
This will dispose the current media and other resources and will put MediaPlayer into the UNREALIZED state. MediaPlayer can be used again.
public void addMediaListener(MediaListener l)
l - The listener to register.IllegalArgumentException - Throws if listener is nullpublic void removeMediaListener(MediaListener l)
l - The MediaListener to add to the MediaPlayer.IllegalArgumentException - Throws if listener is null
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2004 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.