public class VimeoUniversalPlayer
extends com.bramosystems.oss.player.core.client.AbstractMediaPlayer
SimplePanel panel = new SimplePanel(); // create panel to hold the player
Widget player = null;
try {
// create the player
player = new VimeoUniversalPlayer("video-id", false, "100%", "350px");
} catch(PluginVersionException e) {
// catch plugin version exception and alert user to download plugin first.
// An option is to use the utility method in PlayerUtil class.
player = PlayerUtil.getMissingPluginNotice(e.getPlugin(), "Missing Plugin",
".. some nice message telling the user to click and download plugin first ..",
false);
} 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.
Constructor and Description |
---|
VimeoUniversalPlayer(String videoId,
boolean autoplay,
String width,
String height)
Creates a VimeoUniversalPlayer widget to playback the specified
videoId . |
Modifier and Type | Method and Description |
---|---|
long |
getMediaDuration() |
double |
getPlayPosition() |
com.bramosystems.oss.player.core.client.RepeatMode |
getRepeatMode() |
int |
getVideoHeight() |
int |
getVideoWidth() |
double |
getVolume() |
boolean |
isControllerVisible()
Returns the visibility state of the player controls.
|
void |
loadMedia(String mediaURL)
This implementation does nothing.
|
void |
pauseMedia() |
void |
playMedia() |
<C extends com.bramosystems.oss.player.core.client.ConfigParameter> |
setConfigParameter(C param,
Object value) |
void |
setPlayPosition(double position) |
void |
setRepeatMode(com.bramosystems.oss.player.core.client.RepeatMode mode) |
void |
setVolume(double volume) |
void |
stopMedia() |
addDebugHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addLoadingProgressHandler, addMediaInfoHandler, addMouseDownHandler, addMouseMoveHandler, addMouseUpHandler, addPlayerStateHandler, addPlayStateHandler, addToPlayerReadyCommandQueue, fireDebug, fireError, fireLoadingProgress, fireMediaInfoAvailable, firePlayerStateEvent, firePlayStateEvent, getLoopCount, getRate, getWidgetFactory, isPlayerOnPage, isResizeToVideoSize, removeFromPlayerReadyCommandQueue, setControllerVisible, setLoopCount, setRate, setResizeToVideoSize
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
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, sinkBitlessEvent, toString, unsinkEvents
public VimeoUniversalPlayer(String videoId, boolean autoplay, String width, String height) throws com.bramosystems.oss.player.core.client.PluginNotFoundException, com.bramosystems.oss.player.core.client.PluginVersionException
videoId
.videoId
- the identifier of the videoautoplay
- true
to start playback
automatically, false
otherwisewidth
- the width of the player widget, in CSS unitsheight
- the height of the player widget, in CSS unitscom.bramosystems.oss.player.core.client.PluginNotFoundException
- if the client browser is not HTML5 compliantcom.bramosystems.oss.player.core.client.PluginVersionException
- not exactly thrown. Provided for Base API compatibilitypublic void loadMedia(String mediaURL) throws com.bramosystems.oss.player.core.client.LoadException
loadMedia
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
com.bramosystems.oss.player.core.client.LoadException
public void playMedia() throws com.bramosystems.oss.player.core.client.PlayException
playMedia
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
com.bramosystems.oss.player.core.client.PlayException
public void stopMedia()
stopMedia
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public void pauseMedia()
pauseMedia
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public long getMediaDuration()
getMediaDuration
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public double getPlayPosition()
getPlayPosition
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public void setPlayPosition(double position)
setPlayPosition
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public double getVolume()
getVolume
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public void setVolume(double volume)
setVolume
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public void setRepeatMode(com.bramosystems.oss.player.core.client.RepeatMode mode)
setRepeatMode
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public com.bramosystems.oss.player.core.client.RepeatMode getRepeatMode()
getRepeatMode
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public int getVideoHeight()
getVideoHeight
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public int getVideoWidth()
getVideoWidth
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public boolean isControllerVisible()
This implementation ALWAYS return true
isControllerVisible
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
true
. Controller is always visiblepublic <C extends com.bramosystems.oss.player.core.client.ConfigParameter> void setConfigParameter(C param, Object value)
setConfigParameter
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
Copyright © 2009-2013. All Rights Reserved.