public class DefaultMediaListPlayer extends AbstractMediaPlayer implements MediaListPlayer
| Constructor and Description |
|---|
DefaultMediaListPlayer(LibVlc libvlc,
libvlc_instance_t instance)
Create a new media list player.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMediaListPlayerEventListener(MediaListPlayerEventListener listener)
Add a component to be notified of media list player events.
|
void |
enableEvents(int eventMask)
Restrict the set of media list player events that generate event notifications to listeners.
|
MediaList |
getMediaList()
Get the media list.
|
boolean |
isPlaying()
Determine whether or not the media list is playing.
|
String |
mrl(libvlc_media_t mediaInstance)
Get the media resource locator for a media instance.
|
void |
pause()
Pause the media list.
|
void |
play()
Play the media list.
|
boolean |
playItem(int itemIndex)
Play a particular item on the media list.
|
void |
playNext()
Play the next item in the media list.
|
void |
playPrevious()
Play the previous item in the media list.
|
void |
release()
Release the media list player resources.
|
void |
removeMediaListPlayerEventListener(MediaListPlayerEventListener listener)
Remove a component that was previously interested in notifications of media list player
events.
|
void |
setMediaList(MediaList mediaList)
Set the media list (i.e.
|
void |
setMediaPlayer(MediaPlayer mediaPlayer)
Associate an actual media player with the media list player.
|
void |
setMode(MediaListPlayerMode mode)
Set the media list play mode.
|
void |
stop()
Stop the media list.
|
Object |
userData()
Get the user data associated with the media player.
|
void |
userData(Object userData)
Set user data to associate with the media player.
|
public DefaultMediaListPlayer(LibVlc libvlc, libvlc_instance_t instance)
libvlc - native library interfaceinstance - libvlc instancepublic void addMediaListPlayerEventListener(MediaListPlayerEventListener listener)
MediaListPlayeraddMediaListPlayerEventListener in interface MediaListPlayerlistener - component to notifypublic void removeMediaListPlayerEventListener(MediaListPlayerEventListener listener)
MediaListPlayerremoveMediaListPlayerEventListener in interface MediaListPlayerlistener - component to stop notifyingpublic void enableEvents(int eventMask)
MediaListPlayerIf a set of events is not explicitly enabled, then it is expected that all events be enabled.
enableEvents in interface MediaListPlayereventMask - bit mask of events to enablepublic void setMediaPlayer(MediaPlayer mediaPlayer)
MediaListPlayersetMediaPlayer in interface MediaListPlayermediaPlayer - media playerpublic void setMediaList(MediaList mediaList)
MediaListPlayersetMediaList in interface MediaListPlayermediaList - media listpublic MediaList getMediaList()
MediaListPlayergetMediaList in interface MediaListPlayerpublic void play()
MediaListPlayerplay in interface MediaListPlayerpublic void pause()
MediaListPlayerpause in interface MediaListPlayerpublic void stop()
MediaListPlayerstop in interface MediaListPlayerpublic boolean playItem(int itemIndex)
MediaListPlayerThere is a bug in vlc that prevents proper operation of this method, and may cause a fatal JVM failure. This is resolved in vlc 2.0.2 and later.
playItem in interface MediaListPlayeritemIndex - index of the item to playtrue if the item could be played, otherwise falsepublic void playNext()
MediaListPlayerplayNext in interface MediaListPlayerpublic void playPrevious()
MediaListPlayerplayPrevious in interface MediaListPlayerpublic boolean isPlaying()
MediaListPlayerisPlaying in interface MediaListPlayertrue if playing, otherwise falsepublic void setMode(MediaListPlayerMode mode)
MediaListPlayerNote that if you set the play mode to REPEAT before you have played any media then play-back will never start.
setMode in interface MediaListPlayermode - modepublic String mrl(libvlc_media_t mediaInstance)
MediaListPlayerThe native media instance may be an automatically/scripted added sub-item.
mrl in interface MediaListPlayermediaInstance - native media instancepublic Object userData()
MediaListPlayeruserData in interface MediaListPlayerpublic void userData(Object userData)
MediaListPlayeruserData in interface MediaListPlayeruserData - user datapublic final void release()
MediaListPlayerrelease in interface MediaListPlayerCopyright © 2009-2012 Caprica Software Limited. All Rights Reserved.