public class QuickTimePlayer
extends com.bramosystems.oss.player.core.client.AbstractMediaPlayer
implements com.bramosystems.oss.player.core.client.geom.MatrixSupport, com.bramosystems.oss.player.core.client.PlaylistSupport
SimplePanel panel = new SimplePanel(); // create panel to hold the player
Widget player = null;
try {
// create the player
player = new QuickTimePlayer("www.example.com/mediafile.mov");
} 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.
Modifier and Type | Class and Description |
---|---|
static class |
QuickTimePlayer.Scale
An enum of scalling values that can be used to scale the dimensions of a QuickTime movie
|
Constructor and Description |
---|
QuickTimePlayer(String mediaURL)
Constructs
QuickTimePlayer to automatically playback media located at
mediaURL using the default height of 16px and width of 100%. |
QuickTimePlayer(String mediaURL,
boolean autoplay)
Constructs
QuickTimePlayer to playback media located at mediaURL
using the default height of 16px and width of 100%. |
QuickTimePlayer(String mediaURL,
boolean autoplay,
String height,
String width)
Constructs
QuickTimePlayer with the specified height and
width to playback media located at mediaURL . |
Modifier and Type | Method and Description |
---|---|
void |
addToPlaylist(List<com.bramosystems.oss.player.core.client.playlist.MRL> mediaLocators) |
void |
addToPlaylist(com.bramosystems.oss.player.core.client.playlist.MRL mediaLocator) |
void |
addToPlaylist(String... mediaURLs) |
void |
addToPlaylist(String mediaURL) |
void |
clearPlaylist() |
int |
getLoopCount() |
com.bramosystems.oss.player.core.client.geom.TransformationMatrix |
getMatrix() |
long |
getMediaDuration() |
int |
getPlaylistSize() |
double |
getPlayPosition() |
double |
getRate() |
String |
getRectangleBounds()
Returns the location and dimensions of the rectangle bounds of the display
component within the embed area.
|
com.bramosystems.oss.player.core.client.RepeatMode |
getRepeatMode() |
int |
getVideoHeight() |
int |
getVideoWidth() |
double |
getVolume() |
boolean |
isControllerVisible()
Checks whether the player controls are visible.
|
boolean |
isResizeToVideoSize() |
boolean |
isShuffleEnabled() |
void |
loadMedia(String mediaURL) |
protected void |
onLoad()
Overridden to register player for plugin DOM events
|
void |
pauseMedia() |
void |
play(int index) |
void |
playMedia() |
void |
playNext() |
void |
playPrevious() |
void |
removeFromPlaylist(int index) |
<C extends com.bramosystems.oss.player.core.client.ConfigParameter> |
setConfigParameter(C param,
Object value) |
void |
setControllerVisible(boolean show)
Displays or hides the player controls.
|
void |
setLoopCount(int loop)
Sets the number of times the current media file should repeat playback before stopping.
|
void |
setMatrix(com.bramosystems.oss.player.core.client.geom.TransformationMatrix matrix)
Sets the transformation matrix of the underlying QuickTime Player.
|
void |
setPlayPosition(double position) |
void |
setRate(double rate) |
void |
setRectangleBounds(String bounds)
Sets the location and dimensions of the rectangle bounds of the display component
within the embed area.
|
void |
setRepeatMode(com.bramosystems.oss.player.core.client.RepeatMode mode) |
void |
setResizeToVideoSize(boolean resize) |
void |
setShuffleEnabled(boolean enable) |
void |
setVolume(double volume) |
void |
stopMedia() |
addDebugHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addLoadingProgressHandler, addMediaInfoHandler, addMouseDownHandler, addMouseMoveHandler, addMouseUpHandler, addPlayerStateHandler, addPlayStateHandler, addToPlayerReadyCommandQueue, fireDebug, fireError, fireLoadingProgress, fireMediaInfoAvailable, firePlayerStateEvent, firePlayStateEvent, getWidgetFactory, isPlayerOnPage, removeFromPlayerReadyCommandQueue
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, 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 QuickTimePlayer(String mediaURL, boolean autoplay, String height, String width) throws com.bramosystems.oss.player.core.client.PluginVersionException, com.bramosystems.oss.player.core.client.PluginNotFoundException
QuickTimePlayer
with the specified height
and
width
to playback media located at mediaURL
. Media playback
begins automatically if autoplay
is true
.
height
and width
are specified as CSS units. A value of null
for height
or width
puts the player in embedded mode. When in embedded mode,
the player is made invisible on the page and media state events are propagated to registered
listeners only. This is desired especially when used with custom sound controls. For custom
video control, specify valid CSS values for height
and width
but hide the
player controls with setControllerVisible(false)
.
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.com.bramosystems.oss.player.core.client.PluginVersionException
- if the required QuickTime plugin version is not installed on the client.com.bramosystems.oss.player.core.client.PluginNotFoundException
- if the QuickTime plugin is not installed on the client.public QuickTimePlayer(String mediaURL) throws com.bramosystems.oss.player.core.client.PluginVersionException, com.bramosystems.oss.player.core.client.PluginNotFoundException
QuickTimePlayer
to automatically playback media located at
mediaURL
using the default height of 16px and width of 100%.
This is the same as calling QuickTimePlayer(mediaURL, true, "16px", "100%")
mediaURL
- the URL of the media to playbackcom.bramosystems.oss.player.core.client.PluginVersionException
- if the required QuickTime plugin version is not installed on the client.com.bramosystems.oss.player.core.client.PluginNotFoundException
- if the QuickTime plugin is not installed on the client.public QuickTimePlayer(String mediaURL, boolean autoplay) throws com.bramosystems.oss.player.core.client.PluginVersionException, com.bramosystems.oss.player.core.client.PluginNotFoundException
QuickTimePlayer
to playback media located at mediaURL
using the default height of 16px and width of 100%. Media playback begins
automatically if autoplay
is true
.
This is the same as calling QuickTimePlayer(mediaURL, autoplay, "16px", "100%")
mediaURL
- the URL of the media to playbackautoplay
- true
to start playing automatically, false
otherwisecom.bramosystems.oss.player.core.client.PluginVersionException
- if the required QuickTime plugin version is not installed on the client.com.bramosystems.oss.player.core.client.PluginNotFoundException
- if the QuickTime plugin is not installed on the client.protected final void onLoad()
onLoad
in class com.google.gwt.user.client.ui.Widget
public 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 setControllerVisible(boolean show)
As of version 1.0, if this player is not available on the panel, this method call is added to the command-queue for later execution.
setControllerVisible
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public boolean isControllerVisible()
isControllerVisible
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)
As of version 1.0, if this player is not available on the panel, this method call is added to the command-queue for later execution.
setLoopCount
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public String getRectangleBounds()
The value returned is in the form : left,top,right,bottom
public void setRectangleBounds(String bounds)
bounds
- the new location and dimension of the display componentgetRectangleBounds()
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 void setResizeToVideoSize(boolean resize)
setResizeToVideoSize
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public boolean isResizeToVideoSize()
isResizeToVideoSize
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public void setMatrix(com.bramosystems.oss.player.core.client.geom.TransformationMatrix matrix)
If this player is not attached to a panel, this method call is added to the command-queue for later execution.
setMatrix
in interface com.bramosystems.oss.player.core.client.geom.MatrixSupport
public com.bramosystems.oss.player.core.client.geom.TransformationMatrix getMatrix()
getMatrix
in interface com.bramosystems.oss.player.core.client.geom.MatrixSupport
public void setRate(double rate)
setRate
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public double getRate()
getRate
in class com.bramosystems.oss.player.core.client.AbstractMediaPlayer
public <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
public void setShuffleEnabled(boolean enable)
setShuffleEnabled
in interface com.bramosystems.oss.player.core.client.PlaylistSupport
public boolean isShuffleEnabled()
isShuffleEnabled
in interface com.bramosystems.oss.player.core.client.PlaylistSupport
public void addToPlaylist(String mediaURL)
addToPlaylist
in interface com.bramosystems.oss.player.core.client.PlaylistSupport
public void addToPlaylist(com.bramosystems.oss.player.core.client.playlist.MRL mediaLocator)
addToPlaylist
in interface com.bramosystems.oss.player.core.client.PlaylistSupport
public void addToPlaylist(String... mediaURLs)
addToPlaylist
in interface com.bramosystems.oss.player.core.client.PlaylistSupport
public void addToPlaylist(List<com.bramosystems.oss.player.core.client.playlist.MRL> mediaLocators)
addToPlaylist
in interface com.bramosystems.oss.player.core.client.PlaylistSupport
public void removeFromPlaylist(int index)
removeFromPlaylist
in interface com.bramosystems.oss.player.core.client.PlaylistSupport
public void clearPlaylist()
clearPlaylist
in interface com.bramosystems.oss.player.core.client.PlaylistSupport
public void playNext() throws com.bramosystems.oss.player.core.client.PlayException
playNext
in interface com.bramosystems.oss.player.core.client.PlaylistSupport
com.bramosystems.oss.player.core.client.PlayException
public void playPrevious() throws com.bramosystems.oss.player.core.client.PlayException
playPrevious
in interface com.bramosystems.oss.player.core.client.PlaylistSupport
com.bramosystems.oss.player.core.client.PlayException
public void play(int index) throws IndexOutOfBoundsException
play
in interface com.bramosystems.oss.player.core.client.PlaylistSupport
IndexOutOfBoundsException
public int getPlaylistSize()
getPlaylistSize
in interface com.bramosystems.oss.player.core.client.PlaylistSupport
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
Copyright © 2009-2013. All Rights Reserved.