net.rim.plazmic.mediaengine
Class MediaManager

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

Deprecated. Use SVGImage instead.

public class MediaManager
extends Object

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

See Also:
MediaPlayer
Since:
BlackBerry API 3.7.0

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

MediaManager

public MediaManager()
Deprecated. 
The default constructor.

Since:
BlackBerry API 3.7.0

MediaManager

public MediaManager(Connector c)
             throws NullPointerException
Deprecated. 
Creates a MediaManager instance given a connector.

Parameters:
c - The connector used to create the MediaManager.
Throws:
NullPointerException - if c is null.
Since:
BlackBerry API 3.7.0

MediaManager

public 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.

Parameters:
c - The connector used to create the MediaManager.
enableRelative - A boolean indicating whether or not relative URLs are allowed.
Throws:
NullPointerException - if c is null.
Since:
BlackBerry API 3.7.0


Method Detail

setConnector

public void setConnector(Connector connector)
Deprecated. 
Sets the connector for this MediaManager.

Parameters:
connector - The connector to set.
Since:
BlackBerry API 3.7.0

getConnector

public Connector getConnector()
Deprecated. 
Returns the connector for this MediaManager.

Returns:
The connector instance.
Since:
BlackBerry API 3.7.0

getDefaultConnector

public Connector getDefaultConnector()
Deprecated. 
Returns the default connector associated with this MediaManager.

Returns:
The default connector.
Since:
BlackBerry API 3.7.0

setProperty

public void setProperty(String name,
                        String value)
                 throws IllegalArgumentException
Deprecated. 
Set connection properties.

This method allows the user to set any connector specific properties as name value pairs. Set of supported properties is specific to the Connector.

Parameters:
name - The property name to set. Property "URI_BASE" requires value to be an absolute URL
value - The property value to set.
Throws:
IllegalArgumentException - Thrown if the specified property name is not supported, or if the specified property value is invalid.
Since:
BlackBerry API 3.7.0

resolveURL

public String resolveURL(String url)
Deprecated. 
Converts a relative url or an absolute path to an absolute url.

Parameters:
url - A relative or absolute path or absolute url.
Returns:
An absolute url based on the document base.
Since:
BlackBerry API 3.7.0

addMediaListener

public void addMediaListener(MediaListener listener)
Deprecated. 
Adds a listener to the media.

If the specified listener is already in the list of listeners for the media then this method does nothing.

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

removeMediaListener

public void removeMediaListener(MediaListener listener)
Deprecated. 
Removes a listener from the media.

Parameters:
listener - The listener to remove. If null this method does nothing.
Since:
BlackBerry API 3.7.0

createMedia

public Object createMedia(String uri)
                   throws IOException,
                          MediaException
Deprecated. 
Loads media content from a given URI.

Parameters:
uri - A string representing the URI. URI can be relative or absolute URL. Must not be null.
Returns:
An object representing the media content.
Throws:
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").
Since:
BlackBerry API 3.7.0

createMedia

public Object createMedia(String uri,
                          String suggestedType)
                   throws IOException,
                          MediaException
Deprecated. 
Loads the suggested type of media content from a given URI (if it exists). Use this method if the media content type is known to be "audio/midi". Throws an exception if the suggested type does not exist.

Parameters:
uri - A string representing the URI. URI can be relative or absolute URL. Must not be null.
suggestedType - A string representing the Media Type
Returns:
An object representing the media content.
Throws:
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").
Since:
BlackBerry API 4.0.0

createMediaLater

public void createMediaLater(String uri)
Deprecated. 
Loads media content asynchronously given a Uniform Resource Indicator (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.

Parameters:
uri - A string representing the URI.
Since:
BlackBerry API 3.7.0

cancel

public void cancel()
Deprecated. 
Cancels the current download if one exists.

This stops the current download. The download can be restarted from the beginning after a call to cancel() has been made.

Since:
BlackBerry API 3.7.0

dispose

public void dispose()
Deprecated. 
Disposes the download if one exists.

Calling dispose() releases all resources allocated by the manager. This method should be called when MediaManager is no longer needed.

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