|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.plazmic.mediaengine.MediaManager
SVGImage
instead.
public class 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
Constructor Summary | ||
---|---|---|
MediaManager()
Deprecated. The default constructor. |
||
MediaManager(Connector c)
Deprecated. Creates a MediaManager instance given a connector. |
||
MediaManager(Connector c,
boolean enableRelative)
Deprecated. 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)
Deprecated. Adds a listener to the media. |
|
void |
cancel()
Deprecated. Cancels the current download if one exists. |
|
Object |
createMedia(String uri)
Deprecated. Loads media content from a given URI. |
|
Object |
createMedia(String uri,
String suggestedType)
Deprecated. Loads the suggested type of media content from a given URI (if it exists). |
|
void |
createMediaLater(String uri)
Deprecated. Loads media content asynchronously given a Uniform Resource Indicator (URI). |
|
void |
dispose()
Deprecated. Disposes the download if one exists. |
|
Connector |
getConnector()
Deprecated. Returns the connector for this MediaManager . |
|
Connector |
getDefaultConnector()
Deprecated. Returns the default connector associated with this MediaManager. |
|
void |
removeMediaListener(MediaListener listener)
Deprecated. Removes a listener from the media. |
|
String |
resolveURL(String url)
Deprecated. Converts a relative url or an absolute path to an absolute url. |
|
void |
setConnector(Connector connector)
Deprecated. Sets the connector for this MediaManager . |
|
void |
setProperty(String name,
String value)
Deprecated. Set connection properties. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MediaManager()
public MediaManager(Connector c) throws NullPointerException
MediaManager
instance given a connector.
c
- The connector used to create the MediaManager
.
NullPointerException
- if c
is null.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.
NullPointerException
- if c
is null.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
not supported, or if the specified property value is invalid.public String resolveURL(String url)
url
- A relative or absolute path or absolute url.
public void addMediaListener(MediaListener listener)
If the specified listener is already in the list of listeners for the media then this method does nothing.
listener
- The listener to add.
IllegalArgumentException
- if listener
is null.public void removeMediaListener(MediaListener listener)
listener
- The listener to remove. If null this method does nothing.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
- Currently throws a ConnectionNotFoundException (see below).
IllegalArgumentException
- Thrown if the "uri" argument is null or incorrectly formatted (eg. a URI of "zzyzx")
MediaException
- Thrown if the media is not supported, the download has been cancelled,
or a communication error occurs.
ConnectionNotFoundException
- Thrown if the "uri"
argument specifies an unsupported protocol (eg. a URI of "zhttp://www.google.com").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.suggestedType
- A string representing the
Media Type
IOException
- Currently throws a ConnectionNotFoundException (see below).
IllegalArgumentException
- Thrown if the "uri" argument is null or incorrectly formatted (eg. a URI of "zzyzx")
MediaException
- Thrown if the media is not supported, the download has been cancelled,
or a communication error occurs.
ConnectionNotFoundException
- Thrown if the "uri"
argument specifies an unsupported protocol (eg. a URI of "zhttp://www.google.com").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: 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