com.bramosystems.oss.player.core.client.spi
Interface PlayerProviderFactory


public interface PlayerProviderFactory

Interface defines the methods required of player provider implementations. The implementation classes are consulted by the API framework during player widget creation.

Note: Classes that implement this interface should be annotated with PlayerProvider to be recognized during compilation

Since:
1.3
Author:
Sikirulai Braheem

Method Summary
 PluginVersion getDetectedPluginVersion(java.lang.String playerName)
          Returns the version of the plugin required by the specified playerName that is currently installed AND enabled on the browser
 AbstractMediaPlayer getPlayer(java.lang.String playerName, java.lang.String mediaURL, boolean autoplay)
          Returns the player with the specified playerName.
 AbstractMediaPlayer getPlayer(java.lang.String playerName, java.lang.String mediaURL, boolean autoplay, java.lang.String height, java.lang.String width)
          Returns the player with the specified playerName.
 PlayerElement getPlayerElement(java.lang.String playerName, java.lang.String playerId, java.lang.String mediaURL, boolean autoplay, java.util.HashMap<java.lang.String,java.lang.String> params)
          Returns the DOM element structure for the specified playerName.
 

Method Detail

getPlayerElement

PlayerElement getPlayerElement(java.lang.String playerName,
                               java.lang.String playerId,
                               java.lang.String mediaURL,
                               boolean autoplay,
                               java.util.HashMap<java.lang.String,java.lang.String> params)
Returns the DOM element structure for the specified playerName. The DOM element structure will be inserted into the page when required.

Implementation classes should throw IllegalArgumentException if the playerName is not supported by the factory

Parameters:
playerName - the name of the required player
playerId - the HTML element id/name that should be used for the player
mediaURL - the first URL of the media to be loaded by the player
autoplay - true if playback should start immediately, false otherwise
params - other HTML parameters that should be associated with the DOM element
Returns:
the DOM element structure for the specified playerName
Throws:
java.lang.IllegalArgumentException - if playerName does not exist in this factory

getDetectedPluginVersion

PluginVersion getDetectedPluginVersion(java.lang.String playerName)
                                       throws PluginNotFoundException
Returns the version of the plugin required by the specified playerName that is currently installed AND enabled on the browser

The detection methods in the PlayerUtil class may be used by implementation classes if applicable.

Implementation classes should throw IllegalArgumentException if the playerName is not supported by the factory

Parameters:
playerName - the name of the player
Returns:
the version of the required plugin that is installed and enabled on the browser
Throws:
PluginNotFoundException - if the required plugin is not installed AND enabled
java.lang.IllegalArgumentException - if playerName does not exist in this factory

getPlayer

AbstractMediaPlayer getPlayer(java.lang.String playerName,
                              java.lang.String mediaURL,
                              boolean autoplay,
                              java.lang.String height,
                              java.lang.String width)
                              throws LoadException,
                                     PluginNotFoundException,
                                     PluginVersionException
Returns the player with the specified playerName.

Implementation classes should throw IllegalArgumentException if the playerName is not supported by the factory

Parameters:
playerName -
mediaURL - the URL of the media to playback
autoplay - true to start playing automatically, false otherwise
height - the height of the player
width - the width of the player.
Returns:
the player implementation
Throws:
LoadException - if an error occurs while loading the media.
PluginVersionException - if the required plugin version is not installed on the client.
PluginNotFoundException - if the required plugin is not installed on the client.
java.lang.IllegalArgumentException - if playerName does not exist in this factory

getPlayer

AbstractMediaPlayer getPlayer(java.lang.String playerName,
                              java.lang.String mediaURL,
                              boolean autoplay)
                              throws LoadException,
                                     PluginNotFoundException,
                                     PluginVersionException
Returns the player with the specified playerName.

Implementation classes should throw IllegalArgumentException if the playerName is not supported by the factory

Parameters:
playerName -
mediaURL - the URL of the media to playback
autoplay - true to start playing automatically, false otherwise
Returns:
the player implementation
Throws:
LoadException - if an error occurs while loading the media.
PluginVersionException - if the required plugin version is not installed on the client.
PluginNotFoundException - if the required plugin is not installed on the client.
java.lang.IllegalArgumentException - if playerName does not exist in this factory


Copyright © 2009-2011. All Rights Reserved.