public abstract class YouTubeBasePlayer
extends com.bramosystems.oss.player.core.client.AbstractMediaPlayer
Modifier and Type | Class and Description |
---|---|
protected class |
YouTubeBasePlayer.DefaultEventHandler
Default EventHandler implementation for YouTube player events.
|
Modifier and Type | Field and Description |
---|---|
protected String |
_height |
protected String |
_vid |
protected String |
_width |
protected HashMap<String,String> |
configParam |
protected com.bramosystems.oss.player.youtube.client.impl.YouTubePlayerImpl |
impl |
protected String |
playerId |
protected PlayerParameters |
pParams |
Modifier | Constructor and Description |
---|---|
protected |
YouTubeBasePlayer(String videoID,
String width,
String height,
boolean useIframe)
Constructs
YouTubeBasePlayer with the specified height and
width to playback video videoID |
Modifier and Type | Method and Description |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addPlaybackQualityChangeHandler(PlaybackQualityChangeHandler handler)
Adds a
PlaybackQualityChangeHandler handler to the player |
ArrayList<PlaybackQuality> |
getAvailableQualityLevels()
Returns the list of quality formats in which the current video is
available.
|
int |
getLoopCount() |
long |
getMediaDuration() |
PlaybackQuality |
getPlaybackQuality()
Retrieves the playback quality of the current video.
|
double |
getPlayPosition() |
protected com.bramosystems.oss.player.youtube.client.impl.YouTubePlayerProvider |
getProvider()
Convenience method to retrieve the PlayerProvider implementation class
|
com.bramosystems.oss.player.core.client.RepeatMode |
getRepeatMode() |
double |
getVolume() |
boolean |
isControllerVisible()
Checks whether the player controls are visible.
|
void |
loadMedia(String mediaURL) |
protected String |
paramsToString(PlayerParameters playerParameters)
Converts the PlayerParameters object into YouTube™ video URL
parameters.
|
void |
pauseMedia() |
void |
playMedia() |
<C extends com.bramosystems.oss.player.core.client.ConfigParameter> |
setConfigParameter(C param,
Object value) |
void |
setLoopCount(int loop) |
void |
setPlaybackQuality(PlaybackQuality suggestedQuality)
Sets the suggested video quality for the current video.
|
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, 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, 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
protected com.bramosystems.oss.player.youtube.client.impl.YouTubePlayerImpl impl
protected String playerId
protected String _width
protected String _height
protected String _vid
protected PlayerParameters pParams
protected YouTubeBasePlayer(String videoID, String width, String height, boolean useIframe)
YouTubeBasePlayer
with the specified height
and
width
to playback video 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 player plugin version not foundNullPointerException
- if either videoID
, height
or
width
is nullprotected final String paramsToString(PlayerParameters playerParameters)
playerParameters
- the player parameterspublic 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 int getLoopCount()
getLoopCount
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public void setLoopCount(int loop)
setLoopCount
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 void setRepeatMode(com.bramosystems.oss.player.core.client.RepeatMode mode)
setRepeatMode
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public boolean isControllerVisible()
isControllerVisible
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public void setPlaybackQuality(PlaybackQuality suggestedQuality)
Note: Calling this method does not guarantee that the playback quality will actually change. If the playback quality does change, it will only change for the video being played and the PlaybackQualityChangeEvent event will be fired.
If suggestedQuality
is not available for the current video,
then the quality will be set to the next lowest level that is available.
That is, if suggestedQuality
is
PlaybackQuality.hd720 and that is unavailable, then the
playback quality will be set to PlaybackQuality.large if
that quality level is available.
suggestedQuality
- the suggested video quality for the current videopublic PlaybackQuality getPlaybackQuality() throws IllegalStateException
IllegalStateException
- if no video is loaded in the playerpublic ArrayList<PlaybackQuality> getAvailableQualityLevels()
An empty list is returned if no video is loaded.
public com.google.gwt.event.shared.HandlerRegistration addPlaybackQualityChangeHandler(PlaybackQualityChangeHandler handler)
PlaybackQualityChangeHandler
handler to the playerhandler
- handler for the PlaybackQualityChangeEvent eventHandlerRegistration
used to remove the handlerpublic <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
protected com.bramosystems.oss.player.youtube.client.impl.YouTubePlayerProvider getProvider()
Copyright © 2009-2013. All Rights Reserved.