com.bramosystems.oss.player.youtube.client
Class ChromelessPlayer

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by com.bramosystems.oss.player.core.client.AbstractMediaPlayer
                  extended by com.bramosystems.oss.player.youtube.client.YouTubePlayer
                      extended by com.bramosystems.oss.player.youtube.client.ChromelessPlayer
All Implemented Interfaces:
HasMediaMessageHandlers, HasMediaProgressHandlers, HasMediaStateHandlers, HasPlayStateHandlers, com.google.gwt.event.dom.client.HasKeyDownHandlers, com.google.gwt.event.dom.client.HasKeyPressHandlers, com.google.gwt.event.dom.client.HasKeyUpHandlers, com.google.gwt.event.dom.client.HasMouseDownHandlers, com.google.gwt.event.dom.client.HasMouseMoveHandlers, com.google.gwt.event.dom.client.HasMouseUpHandlers, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.IsWidget

public class ChromelessPlayer
extends YouTubePlayer

Widget to embed the chromeless YouTube video player. The player is particularly useful when embedding YouTube with custom controls.

Usage Example

 SimplePanel panel = new SimplePanel();   // create panel to hold the player
 Widget player = null;
 try {
      // create the player
      player = new ChromelessPlayer("http://www.youtube.com/v/VIDEO_ID&fs=1", "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.
 

Since:
1.1
Author:
Sikirulai Braheem

Nested Class Summary
 
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.youtube.client.YouTubePlayer
_height, _vURL, _width, impl, playerId
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
ChromelessPlayer(String videoURL, PlayerParameters playerParameters, String width, String height)
          Constructs ChromelessPlayer with the specified height and width to playback video located at videoURL using the specified playerParameters
ChromelessPlayer(String videoURL, String width, String height)
          Constructs ChromelessPlayer with the specified height and width to playback video located at videoURL
 
Method Summary
protected  String getNormalizedVideoAppURL(String videoURL, PlayerParameters playerParameters)
          Returns the normalized URL of the video.
 boolean isControllerVisible()
          Checks whether the player controls are visible.
protected  void playerInit()
          Called when player initialization is completed.
 
Methods inherited from class com.bramosystems.oss.player.youtube.client.YouTubePlayer
addPlaybackQualityChangeHandler, getAvailableQualityLevels, getLoopCount, getMediaDuration, getPlaybackQuality, getPlayPosition, getRepeatMode, getVolume, loadMedia, onLoad, onUnload, paramsToString, parseURLParams, pauseMedia, playMedia, setConfigParameter, setLoopCount, setPlaybackQuality, setPlayPosition, setRepeatMode, setVolume, showLogger, stopMedia
 
Methods inherited from class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
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, setConfigParameter, setConfigParameter, setControllerVisible, setRate, setResizeToVideoSize
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getWidget, initWidget, 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, 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

ChromelessPlayer

public ChromelessPlayer(String videoURL,
                        String width,
                        String height)
                 throws PluginNotFoundException,
                        PluginVersionException
Constructs ChromelessPlayer with the specified height and width to playback video located at videoURL

height and width are specified as CSS units.

Parameters:
videoURL - the URL of the video
width - the width of the player
height - the height of the player
Throws:
PluginNotFoundException - if the required Flash player plugin is not found
PluginVersionException - if Flash player version 8 and above is not found
NullPointerException - if either videoURL, height or width is null

ChromelessPlayer

public ChromelessPlayer(String videoURL,
                        PlayerParameters playerParameters,
                        String width,
                        String height)
                 throws PluginNotFoundException,
                        PluginVersionException
Constructs ChromelessPlayer with the specified height and width to playback video located at videoURL using the specified playerParameters

height and width are specified as CSS units.

Parameters:
videoURL - the URL of the video
playerParameters - the parameters of the player
width - the width of the player
height - the height of the player
Throws:
PluginNotFoundException - if the required Flash player plugin is not found
PluginVersionException - if Flash player version 8 and above is not found
NullPointerException - if either videoURL, height or width is null
Method Detail

getNormalizedVideoAppURL

protected String getNormalizedVideoAppURL(String videoURL,
                                          PlayerParameters playerParameters)
Description copied from class: YouTubePlayer
Returns the normalized URL of the video.

This method is called by the player Constructors. It adjusts the parameters that may be present in the videoURL and playerParameters (possibly overriding some) to match the requirements of this players' internals.

Overrides:
getNormalizedVideoAppURL in class YouTubePlayer
Parameters:
videoURL - the URL of the YouTube™ video
playerParameters - the parameters of the video
Returns:
the normalized URL of the video

playerInit

protected void playerInit()
Description copied from class: YouTubePlayer
Called when player initialization is completed.

Overrides:
playerInit in class YouTubePlayer

isControllerVisible

public boolean isControllerVisible()
Checks whether the player controls are visible. This implementation always return false.

Overrides:
isControllerVisible in class YouTubePlayer
Returns:
true if player controls are visible, false otherwise.


Copyright © 2009-2011. All Rights Reserved.