|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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.CustomVideoPlayer
com.bramosystems.oss.player.flat.client.FlatVideoPlayer
public class FlatVideoPlayer
Custom video player implementation using CustomPlayerControl
SimplePanel panel = new SimplePanel(); // create panel to hold the player
Widget player = null;
try {
// create the player
player = new FlatVideoPlayer("www.example.com/videofile.mp4", false, "150px", "100%");
} 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 |
---|
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.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
FlatVideoPlayer(Plugin plugin,
String mediaURL,
boolean autoplay,
String height,
String width)
Constructs FlatVideoPlayer player with the specified height and
width to playback media located at mediaURL using the specified
media plugin. |
|
FlatVideoPlayer(String mediaURL,
boolean autoplay,
String height,
String width)
Constructs FlatVideoPlayer player with the specified height and
width to playback media located at mediaURL using a dynamically
determined plugin. |
Method Summary | |
---|---|
protected void |
onVideoDimensionChanged(int width,
int height)
Called when the size of the embedded player changes to match the dimension of the media (especially video) |
void |
showLogger(boolean enable)
Displays or hides the players' logger widget. |
Methods inherited from class com.bramosystems.oss.player.core.client.skin.CustomVideoPlayer |
---|
addToPlaylist, addToPlaylist, addToPlaylist, addToPlaylist, clearPlaylist, getLoopCount, getMatrix, getMediaDuration, getPlaylistSize, getPlayPosition, getRate, getRepeatMode, getVideoHeight, getVideoWidth, getVolume, initWidget, isControllerVisible, isResizeToVideoSize, isShuffleEnabled, loadMedia, pauseMedia, play, playMedia, playNext, playPrevious, removeFromPlaylist, setConfigParameter, setConfigParameter, setConfigParameter, setControllerVisible, setLoopCount, setMatrix, setPlayerControlWidget, setPlayPosition, setRate, setRepeatMode, setResizeToVideoSize, setShuffleEnabled, setVolume, 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, getWidgetFactory, isPlayerOnPage, removeFromPlayerReadyCommandQueue |
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, onUnload, 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 FlatVideoPlayer(Plugin plugin, String mediaURL, boolean autoplay, String height, String width) throws PluginNotFoundException, PluginVersionException, LoadException
FlatVideoPlayer
player with the specified height
and
width
to playback media located at mediaURL
using the specified
media plugin. Media playback begins automatically if autoplay
is true
.
height
and width
are specified as CSS units. A minimum value of 20px should
be specified for height
to enable a proper display of the controls.
mediaURL
- the URL of the media to playbackautoplay
- true
to start playing automatically, false
otherwiseheight
- the height of the playerwidth
- the width of the player.
LoadException
- if an error occurs while loading the media.
PluginVersionException
- if the required player plugin version is not installed on the client.
PluginNotFoundException
- if the player plugin is not installed on the client.
NullPointerException
- if height
or width
is null
public FlatVideoPlayer(String mediaURL, boolean autoplay, String height, String width) throws PluginNotFoundException, PluginVersionException, LoadException
FlatVideoPlayer
player with the specified height
and
width
to playback media located at mediaURL
using a dynamically
determined plugin. Media playback begins automatically if autoplay
is true
.
This is the same as calling FlatVideoPlayer(Plugin.Auto, mediaURL,
autoplay, height, width)
height
and width
are specified as CSS units. A minimum value of 20px should
be specified for height
to enable a proper display of the controls.
mediaURL
- the URL of the media to playbackautoplay
- true
to start playing automatically, false
otherwiseheight
- the height of the playerwidth
- the width of the player.
LoadException
- if an error occurs while loading the media.
PluginVersionException
- if the required player plugin version is not installed on the client.
PluginNotFoundException
- if the player plugin is not installed on the client.
NullPointerException
- if height
or width
is null
Method Detail |
---|
public void showLogger(boolean enable)
AbstractMediaPlayer
showLogger
in class CustomVideoPlayer
enable
- true
to make the logger widget visible, false
otherwise.Logger
protected void onVideoDimensionChanged(int width, int height)
CustomVideoPlayer
This method is called whenever the PlayerStateEvent
event is fired
with State.DimensionChangedOnVideo
state.
onVideoDimensionChanged
in class CustomVideoPlayer
width
- the width of the media (in pixels)height
- the height of the media (in pixels)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |