|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.plazmic.mediaengine.MediaPlayer
SVGAnimator
instead.
public class 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 int |
REALIZED
Deprecated. Represents the REALIZED state. |
|
static int |
STARTED
Deprecated. Represents the STARTED state. |
|
static int |
UNREALIZED
Deprecated. Represents the UNREALIZED state. |
Constructor Summary | ||
---|---|---|
MediaPlayer()
Deprecated. Constructor. |
Method Summary | ||
---|---|---|
void |
addMediaListener(MediaListener l)
Deprecated. Registers a listener with the MediaPlayer. |
|
void |
close()
Deprecated. Closes an instance of MediaPlayer. |
|
Object |
getMedia()
Deprecated. Returns current media object, as previously specified in the MediaPlayer.setMedia(java.lang.Object) method. |
|
long |
getMediaTime()
Deprecated. Returns the current media time in milliseconds. |
|
int |
getState()
Deprecated. Returns the current state. |
|
Object |
getUI()
Deprecated. Returns platform specific UI component into which the media will be loaded. |
|
void |
removeMediaListener(MediaListener l)
Deprecated. Unregisters a listener from the MediaPlayer. |
|
void |
setMedia(Object media)
Deprecated. Sets the already constructed media for the playback. |
|
void |
setMediaTime(long time)
Deprecated. Sets the media time in milliseconds. |
|
void |
start()
Deprecated. Starts playback of the media content. |
|
void |
stop()
Deprecated. 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 int UNREALIZED
public static final int REALIZED
public static final int STARTED
Constructor Detail |
---|
public MediaPlayer()
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
MediaPlayer.REALIZED
state when this method is invoked. Media playback
commences at time zero (0) so that specifying a negative time is equivalent
to a start time delay.
time
- The specified time in milliseconds used to set the MediaPlayer time.
MediaException
- Thrown if the MediaPlayer's state is not MediaPlayer.REALIZED
public long getMediaTime()
MediaPlayer.setMedia(java.lang.Object)
.public Object getMedia()
MediaPlayer.setMedia(java.lang.Object)
method.
MediaPlayer.setMedia(java.lang.Object)
public void setMedia(Object media) throws MediaException
The media object is created via one of the following methods:
MediaManager.createMedia(String)
MediaManager.createMedia(String, String)
MediaManager.createMediaLater(String)
media
- The media object to be set. If null, then any current media object
is disposed and the MediaPlayer state changes to MediaPlayer.UNREALIZED
.
MediaException
- Thrown if the media type is not supported.public 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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal