net.rim.plazmic.mediaengine
Class MediaPlayer

java.lang.Object
  extended by net.rim.plazmic.mediaengine.MediaPlayer

Deprecated. Use SVGAnimator instead.

public class MediaPlayer
extends Object

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().

See Also:
MediaManager
Since:
BlackBerry API 3.7.0

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

UNREALIZED

public static final int UNREALIZED
Deprecated. 
Represents the UNREALIZED state.

See Also:
Constant Field Values
Since:
BlackBerry API 3.7.0

REALIZED

public static final int REALIZED
Deprecated. 
Represents the REALIZED state.

See Also:
Constant Field Values
Since:
BlackBerry API 3.7.0

STARTED

public static final int STARTED
Deprecated. 
Represents the STARTED state.

See Also:
Constant Field Values
Since:
BlackBerry API 3.7.0


Constructor Detail

MediaPlayer

public MediaPlayer()
Deprecated. 
Constructor. Uses a @link { MediaField } as the default base component field.

Since:
BlackBerry API 3.7.0


Method Detail

getState

public int getState()
Deprecated. 
Returns the current state.

One of UNREALIZED, REALIZED, STARTED.

Returns:
An integer representing the state.
Since:
BlackBerry API 3.7.0

start

public void start()
           throws MediaException
Deprecated. 
Starts playback of the media content. If MediaPlayer is in UNREALIZED state then this method will throw an exception. MediaPlayer enters the STARTED state when this method is called. This method does not reset the media time to 0.

Throws:
MediaException - Thrown if MediaPlayer is in the UNREALIZED state or if no media content exists.
Since:
BlackBerry API 3.7.0

stop

public void stop()
Deprecated. 
Stops playback of the media.

MediaPlayer enters the REALIZED state when this method is called.

Since:
BlackBerry API 3.7.0

setMediaTime

public void setMediaTime(long time)
                  throws MediaException
Deprecated. 
Sets the media time in milliseconds. The MediaPlayer must be in the 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.

Parameters:
time - The specified time in milliseconds used to set the MediaPlayer time.
Throws:
MediaException - Thrown if the MediaPlayer's state is not MediaPlayer.REALIZED
Since:
BlackBerry API 3.7.0

getMediaTime

public long getMediaTime()
Deprecated. 
Returns the current media time in milliseconds.

Returns:
The current MediaPlayer time in milliseconds, or 0 if invoked prior to MediaPlayer.setMedia(java.lang.Object).
Since:
BlackBerry API 3.7.0

getMedia

public Object getMedia()
Deprecated. 
Returns current media object, as previously specified in the MediaPlayer.setMedia(java.lang.Object) method.

Returns:
The current media object, or null if there is no media object currently set.
See Also:
MediaPlayer.setMedia(java.lang.Object)
Since:
BlackBerry API 3.7.0

setMedia

public void setMedia(Object media)
              throws MediaException
Deprecated. 
Sets the already constructed media for the playback. This method will throw a MediaException if this player does not support the given media.

The media object is created via one of the following methods:

Parameters:
media - The media object to be set. If null, then any current media object is disposed and the MediaPlayer state changes to MediaPlayer.UNREALIZED.
Throws:
MediaException - Thrown if the media type is not supported.
Since:
BlackBerry API 3.7.0

getUI

public Object getUI()
Deprecated. 
Returns platform specific UI component into which the media will be loaded.

This UI object does not provide any additional public interface.

Returns:
The UI object.
Since:
BlackBerry API 3.7.0

close

public void close()
Deprecated. 
Closes an instance of MediaPlayer.

This will dispose the current media and other resources and will put MediaPlayer into the UNREALIZED state. MediaPlayer can be used again.

Since:
BlackBerry API 3.7.0

addMediaListener

public void addMediaListener(MediaListener l)
Deprecated. 
Registers a listener with the MediaPlayer.

Parameters:
l - The listener to register.
Throws:
IllegalArgumentException - Throws if listener is null
Since:
BlackBerry API 3.7.0

removeMediaListener

public void removeMediaListener(MediaListener l)
Deprecated. 
Unregisters a listener from the MediaPlayer.

Parameters:
l - The MediaListener to add to the MediaPlayer.
Throws:
IllegalArgumentException - Throws if listener is null
Since:
BlackBerry API 3.7.0





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