|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.plazmic.mediaengine.MediaManager
MediaManager class for downloading media content from the Internet or local
storage.
MediaManager downloads media content and resources and instantiates media data
object that can be passed to the MediaPlayer for playback using
MediaPlayer.setMedia(java.lang.Object).
MediaPlayer| Field Summary |
| Constructor Summary | ||
MediaManager()
The default constructor. |
||
MediaManager(Connector c)
Creates a MediaManager instance given a connector.
|
||
MediaManager(Connector c,
boolean enableRelative)
Creates a MediaManager instance given a connector and a
boolean that indicates whether or not relative URLs are enabled.
|
||
| Method Summary | ||
void |
addMediaListener(MediaListener listener)
Adds a listener to the media. |
|
void |
cancel()
Cancels the current download if one exists. |
|
Object |
createMedia(String uri)
Loads media content from a given URI. |
|
Object |
createMedia(String uri,
String suggestedType)
Loads media content from a given URI. |
|
void |
createMediaLater(String uri)
Loads media content asynchronously given a Uniform Resource Indicator (URI). |
|
void |
dispose()
Disposes the download if one exists. |
|
Connector |
getConnector()
Returns the connector for this MediaManager.
|
|
Connector |
getDefaultConnector()
Returns the default connector associated with this MediaManager. |
|
void |
removeMediaListener(MediaListener listener)
Removes a listener from the media. |
|
String |
resolveURL(String url)
Converts a relative url or an absolute path to an absolute url. |
|
void |
setConnector(Connector connector)
Sets the connector for this MediaManager.
|
|
void |
setProperty(String name,
String value)
Set connection properties. |
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
| Constructor Detail |
public MediaManager(Connector c)
MediaManager instance given a connector.
c - The connector used to create the MediaManager.public MediaManager(Connector c, boolean enableRelative)
MediaManager instance given a connector and a
boolean that indicates whether or not relative URLs are enabled.
c - The connector used to create the MediaManager.enableRelative - A boolean indicating whether or not relative URLs
are allowed.| Method Detail |
public void setConnector(Connector connector)
MediaManager.
connector - The connector to set.public Connector getConnector()
MediaManager.
public Connector getDefaultConnector()
public void setProperty(String name, String value) throws IllegalArgumentException
This method allows the user to set any connector specific properties as name value pairs. Set of supported properties is specific to the Connector.
name - The property name to set.
Property "URI_BASE" requires value to be an absolute URLvalue - The property value to set.IllegalArgumentException - Thrown if the specified property name is invalid.
exception if the property is not supportedpublic String resolveURL(String url)
url - A relative or absolute path or absolute url.public void addMediaListener(MediaListener listener)
listener - The listener to add. If null throws
java.lang.IllegalArgumentException.public void removeMediaListener(MediaListener listener)
listener - The listener to remove. If null throws
java.lang.IllegalArgumentException.public Object createMedia(String uri) throws IOException, MediaException
uri - A string representing the URI. URI can be relative or absolute URL.
Must not be null.IOException - Thrown if the i/o error occured during the download
or parsing of the data.MediaException - Thrown if the media is not supported or the download has been cancelled.public Object createMedia(String uri, String suggestedType) throws IOException, MediaException
uri - A string representing the URI. URI can be relative or absolute URL.
Must not be null.
* @param suggestedType A string representing the MediaType @link MediaType
Must not be null.IOException - Thrown if the i/o error occured during the download
or parsing of the data.MediaException - Thrown if the media is not supported or the download has been cancelled.public void createMediaLater(String uri)
Once download is complete the listeners will be notified with the event
MediaListener.MEDIA_REALIZED. If download fails the listeners will
be notified with the event MediaListener.MEDIA_LOADING_FAILED.
Subsequent calls prior to download completion will automatically
cancel the previous request.
uri - A string representing the URI.public void cancel()
This stops the current download. The download can be restarted from the beginning after a call to cancel() has been made.
public void dispose()
Calling dispose() releases all resources allocated by the manager. This
method should be called when MediaManager is no longer needed.
|
|||||||||
| 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.