|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.user.client.ui.UIObject com.google.gwt.user.client.ui.Widget com.google.gwt.user.client.ui.Composite com.bramosystems.oss.player.core.client.AbstractMediaPlayer com.bramosystems.oss.player.core.client.skin.CustomAudioPlayer com.bramosystems.oss.player.capsule.client.Capsule
public class Capsule
Sample custom sound player.
SimplePanel panel = new SimplePanel(); // create panel to hold the player
Widget player = null;
try {
// create the player
player = new Capsule("www.example.com/mediafile.wma");
} catch(LoadException e) {
// catch loading exception and alert user
Window.alert("An error occured while loading");
} catch(PluginVersionException e) {
// catch plugin version exception and alert user, possibly providing a link
// to the plugin download page.
player = new HTML(".. some nice message telling the user to download plugin first ..");
} catch(PluginNotFoundException e) {
// catch PluginNotFoundException and tell user to download plugin, possibly providing
// a link to the plugin download page.
player = new HTML(".. another kind of message telling the user to download plugin..");
}
panel.setWidget(player); // add player to panel.
Nested Class Summary | |
---|---|
static interface |
Capsule.CapsuleUIResource
Defines the CSS class names used by the Capsule widget. |
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.bramosystems.oss.player.core.client.skin.CustomAudioPlayer |
---|
logger |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
Capsule(Plugin plugin,
java.lang.String mediaURL,
boolean autoplay)
Constructs Capsule player to automatically playback the
media located at mediaURL , if autoplay is true using
the specified plugin . |
|
Capsule(Plugin plugin,
java.lang.String mediaURL,
boolean autoplay,
Capsule.CapsuleUIResource uiResource)
Constructs Capsule player to automatically playback the
media located at mediaURL , if autoplay is true using
the specified plugin . |
|
Capsule(java.lang.String mediaURL)
Constructs Capsule player to automatically playback the
media located at mediaURL . |
|
Capsule(java.lang.String mediaURL,
boolean autoplay)
Constructs Capsule player to automatically playback the
media located at mediaURL , if autoplay is true . |
Method Summary | |
---|---|
protected void |
onUnload()
Overridden to release resources. |
Methods inherited from class com.bramosystems.oss.player.core.client.skin.CustomAudioPlayer |
---|
addToPlaylist, addToPlaylist, addToPlaylist, addToPlaylist, clearPlaylist, getLoopCount, getMediaDuration, getPlaylistSize, getPlayPosition, getRate, getRepeatMode, getVolume, initWidget, isShuffleEnabled, loadMedia, pauseMedia, play, playMedia, playNext, playPrevious, removeFromPlaylist, setConfigParameter, setConfigParameter, setConfigParameter, setLoopCount, setPlayerControlWidget, setPlayPosition, setRate, setRepeatMode, setShuffleEnabled, setVolume, showLogger, stopMedia |
Methods inherited from class com.google.gwt.user.client.ui.Composite |
---|
getWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, removeFromParent, setLayoutData, sinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Constructor Detail |
---|
public Capsule(java.lang.String mediaURL) throws PluginNotFoundException, PluginVersionException, LoadException
Capsule
player to automatically playback the
media located at mediaURL
.
mediaURL
- the URL of the media to playback
LoadException
- if an error occurs while loading the media.
PluginVersionException
- if the required plugin version is not installed on the client.
PluginNotFoundException
- if the plugin is not installed on the client.public Capsule(java.lang.String mediaURL, boolean autoplay) throws PluginNotFoundException, PluginVersionException, LoadException
Capsule
player to automatically playback the
media located at mediaURL
, if autoplay
is true
.
mediaURL
- the URL of the media to playbackautoplay
- true
to start playing automatically, false
otherwise
LoadException
- if an error occurs while loading the media.
PluginVersionException
- if the required plugin version is not installed on the client.
PluginNotFoundException
- if the plugin is not installed on the client.public Capsule(Plugin plugin, java.lang.String mediaURL, boolean autoplay) throws PluginNotFoundException, PluginVersionException, LoadException
Capsule
player to automatically playback the
media located at mediaURL
, if autoplay
is true
using
the specified plugin
.
This constructor uses the default CapsuleResourcePack
to build the UI controls.
plugin
- plugin to use for playback.mediaURL
- the URL of the media to playbackautoplay
- true
to start playing automatically, false
otherwise
LoadException
- if an error occurs while loading the media.
PluginVersionException
- if the required plugin version is not installed on the client.
PluginNotFoundException
- if the plugin is not installed on the client.Plugin
public Capsule(Plugin plugin, java.lang.String mediaURL, boolean autoplay, Capsule.CapsuleUIResource uiResource) throws PluginNotFoundException, PluginVersionException, LoadException
Capsule
player to automatically playback the
media located at mediaURL
, if autoplay
is true
using
the specified plugin
.
plugin
- plugin to use for playback.mediaURL
- the URL of the media to playbackautoplay
- true
to start playing automatically, false
otherwiseuiResource
- the CSS resource to use for the UI
LoadException
- if an error occurs while loading the media.
PluginVersionException
- if the required plugin version is not installed on the client.
PluginNotFoundException
- if the plugin is not installed on the client.Plugin
Method Detail |
---|
protected void onUnload()
onUnload
in class com.google.gwt.user.client.ui.Widget
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |