public class VLCPlayer
extends com.bramosystems.oss.player.core.client.AbstractMediaPlayer
implements 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 VLCPlayer("www.example.com/mediafile.vob");
} 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 |
VLCPlayer.AudioChannelMode
An enum of Audio Channel modes for VLC Media Player™
|
Constructor and Description |
---|
VLCPlayer(String mediaURL)
Constructs
VLCPlayer to automatically playback media located at
mediaURL using the default height of 20px and width of 100%. |
VLCPlayer(String mediaURL,
boolean autoplay)
Constructs
VLCPlayer to playback media located at mediaURL
using the default height of 20px and width of 100%. |
VLCPlayer(String mediaURL,
boolean autoplay,
String height,
String width)
Constructs
VLCPlayer 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() |
VLCPlayer.AudioChannelMode |
getAudioChannelMode()
Gets the current audio channel mode of the player
|
int |
getLoopCount() |
long |
getMediaDuration() |
int |
getPlaylistSize() |
double |
getPlayPosition() |
double |
getRate() |
com.bramosystems.oss.player.core.client.RepeatMode |
getRepeatMode() |
int |
getVideoHeight() |
int |
getVideoWidth() |
double |
getVolume() |
boolean |
isControllerVisible() |
boolean |
isResizeToVideoSize() |
boolean |
isShuffleEnabled() |
void |
loadMedia(String mediaURL) |
protected void |
onLoad()
Overridden to register player for plugin events
|
protected void |
onUnload()
Overridden to release resources
|
void |
pauseMedia() |
void |
play(int index) |
void |
playMedia() |
void |
playNext() |
void |
playPrevious() |
void |
removeFromPlaylist(int index) |
void |
setAudioChannelMode(VLCPlayer.AudioChannelMode mode)
Sets the audio channel mode of the player
|
void |
setControllerVisible(boolean show) |
void |
setLoopCount(int loop)
Sets the number of times the current media file should repeat playback
before stopping.
|
void |
setPlayPosition(double position) |
void |
setRate(double rate) |
void |
setRepeatMode(com.bramosystems.oss.player.core.client.RepeatMode mode) |
void |
setResizeToVideoSize(boolean resize) |
void |
setShuffleEnabled(boolean enable) |
void |
setVolume(double volume) |
void |
stopMedia() |
void |
toggleFullScreen() |
addDebugHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addLoadingProgressHandler, addMediaInfoHandler, addMouseDownHandler, addMouseMoveHandler, addMouseUpHandler, addPlayerStateHandler, addPlayStateHandler, addToPlayerReadyCommandQueue, fireDebug, fireError, fireLoadingProgress, fireMediaInfoAvailable, firePlayerStateEvent, firePlayStateEvent, getWidgetFactory, isPlayerOnPage, removeFromPlayerReadyCommandQueue, setConfigParameter
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 VLCPlayer(String mediaURL, boolean autoplay, String height, String width) throws com.bramosystems.oss.player.core.client.PluginVersionException, com.bramosystems.oss.player.core.client.PluginNotFoundException
VLCPlayer
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 play playing automatically, false
otherwiseheight
- the height of the playerwidth
- the width of the player.com.bramosystems.oss.player.core.client.PluginVersionException
- if the required VLCPlayer plugin version
is not installed on the client.com.bramosystems.oss.player.core.client.PluginNotFoundException
- if the VLCPlayer plugin is not installed
on the client.public VLCPlayer(String mediaURL) throws com.bramosystems.oss.player.core.client.PluginVersionException, com.bramosystems.oss.player.core.client.PluginNotFoundException
VLCPlayer
to automatically playback media located at
mediaURL
using the default height of 20px and width of 100%.mediaURL
- the URL of the media to playbackcom.bramosystems.oss.player.core.client.PluginVersionException
- if the required VLCPlayer plugin version
is not installed on the client.com.bramosystems.oss.player.core.client.PluginNotFoundException
- if the VLCPlayer plugin is not installed
on the client.public VLCPlayer(String mediaURL, boolean autoplay) throws com.bramosystems.oss.player.core.client.PluginVersionException, com.bramosystems.oss.player.core.client.PluginNotFoundException
VLCPlayer
to playback media located at mediaURL
using the default height of 20px and width of 100%. Media playback begins
automatically if autoplay
is true
.mediaURL
- the URL of the media to playbackautoplay
- true
to play playing automatically, false
otherwisecom.bramosystems.oss.player.core.client.PluginVersionException
- if the required VLCPlayer plugin version
is not installed on the client.com.bramosystems.oss.player.core.client.PluginNotFoundException
- if the VLCPlayer plugin is not installed
on the client.protected final void onLoad()
onLoad
in class com.google.gwt.user.client.ui.Widget
protected void onUnload()
onUnload
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 play(int index) throws IndexOutOfBoundsException
play
in interface com.bramosystems.oss.player.core.client.PlaylistSupport
IndexOutOfBoundsException
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 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)
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 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 boolean isShuffleEnabled()
isShuffleEnabled
in interface com.bramosystems.oss.player.core.client.PlaylistSupport
public void setShuffleEnabled(boolean enable)
setShuffleEnabled
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 int getPlaylistSize()
getPlaylistSize
in interface com.bramosystems.oss.player.core.client.PlaylistSupport
public void setAudioChannelMode(VLCPlayer.AudioChannelMode mode)
Use getAudioChannelMode() to check if setting of the audio channel is succeessful
mode
- the audio channel modegetAudioChannelMode()
public VLCPlayer.AudioChannelMode getAudioChannelMode()
setAudioChannelMode(AudioChannelMode)
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 toggleFullScreen()
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 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 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.