public class YouTubeIPlayer extends YouTubeBasePlayer
SimplePanel panel = new SimplePanel(); // create panel to hold the player
Widget player = null;
try {
// create the player
player = new YouTubeIPlayer("VIDEO_ID", "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());
} 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.
YouTubeBasePlayer.DefaultEventHandler
_height, _vid, _width, configParam, impl, playerId, pParams
Constructor and Description |
---|
YouTubeIPlayer(String videoID,
String width,
String height)
Constructs
YouTubeIPlayer with the specified height and
width to playback video with videoID |
Modifier and Type | Method and Description |
---|---|
protected void |
onLoad() |
protected void |
onUnload() |
addPlaybackQualityChangeHandler, getAvailableQualityLevels, getLoopCount, getMediaDuration, getPlaybackQuality, getPlayPosition, getProvider, getRepeatMode, getVolume, isControllerVisible, loadMedia, paramsToString, pauseMedia, playMedia, setConfigParameter, setLoopCount, setPlaybackQuality, setPlayPosition, setRepeatMode, setVolume, stopMedia
addDebugHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addLoadingProgressHandler, addMediaInfoHandler, addMouseDownHandler, addMouseMoveHandler, addMouseUpHandler, addPlayerStateHandler, addPlayStateHandler, addToPlayerReadyCommandQueue, fireDebug, fireError, fireLoadingProgress, fireMediaInfoAvailable, firePlayerStateEvent, firePlayStateEvent, getRate, getVideoHeight, getVideoWidth, getWidgetFactory, isPlayerOnPage, isResizeToVideoSize, removeFromPlayerReadyCommandQueue, setControllerVisible, 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, 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 YouTubeIPlayer(String videoID, String width, String height) throws com.bramosystems.oss.player.core.client.PluginNotFoundException, com.bramosystems.oss.player.core.client.PluginVersionException
YouTubeIPlayer
with the specified height
and
width
to playback video with videoID
height
and width
are specified as CSS units.
videoID
- the ID of the videowidth
- the width of the playerheight
- the height of the playercom.bramosystems.oss.player.core.client.PluginNotFoundException
- if the required player plugin is not foundcom.bramosystems.oss.player.core.client.PluginVersionException
- if the required plugin version is not foundNullPointerException
- if either videoID
, height
or
width
is nullCopyright © 2009-2013. All Rights Reserved.