org.gstreamer.media
public abstract class AbstractMediaPlayer extends Object implements MediaPlayer
MediaListener
and playlist management.Modifier and Type | Field and Description |
---|---|
protected Executor |
eventExecutor |
protected Queue<URI> |
playList |
Modifier | Constructor and Description |
---|---|
protected |
AbstractMediaPlayer(Executor eventExecutor) |
Modifier and Type | Method and Description |
---|---|
void |
addMediaListener(MediaListener listener)
Adds a
MediaListener that will be notified of media events. |
void |
enqueue(Collection<URI> playlist)
Adds a list of media files to the playlist.
|
void |
enqueue(URI uri)
Adds a uri to the playlist
|
protected void |
fireEndOfMediaEvent(EndOfMediaEvent ev) |
protected void |
firePauseEvent(PauseEvent ev) |
protected void |
fireStartEvent(StartEvent ev) |
protected void |
fireStopEvent(StopEvent ev) |
protected List<MediaListener> |
getMediaListeners()
Gets the current list of media listeners
|
void |
remove(URI uri)
Removes a file from the play list.
|
void |
removeMediaListener(MediaListener listener)
Adds a
MediaListener that will be notified of media events. |
void |
setPlaylist(Collection<URI> playlist)
Replaces the current play list with a new play list.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPipeline, getVolume, isPlaying, pause, play, setAudioSink, setURI, setVideoSink, setVolume, stop
protected final Executor eventExecutor
protected AbstractMediaPlayer(Executor eventExecutor)
protected void fireEndOfMediaEvent(EndOfMediaEvent ev)
protected void fireStartEvent(StartEvent ev)
protected void fireStopEvent(StopEvent ev)
protected void firePauseEvent(PauseEvent ev)
public void enqueue(URI uri)
enqueue
in interface MediaPlayer
uri
- The uri to add to the playlist.public void enqueue(Collection<URI> playlist)
enqueue
in interface MediaPlayer
playlist
- The list of media files to add.public void setPlaylist(Collection<URI> playlist)
setPlaylist
in interface MediaPlayer
playlist
- The new playlist.public void remove(URI uri)
remove
in interface MediaPlayer
uri
- The uri to remove.public void addMediaListener(MediaListener listener)
MediaListener
that will be notified of media events.addMediaListener
in interface MediaPlayer
listener
- the MediaListener to add.public void removeMediaListener(MediaListener listener)
MediaListener
that will be notified of media events.removeMediaListener
in interface MediaPlayer
listener
- the MediaListener to add.protected List<MediaListener> getMediaListeners()
MediaListener
Copyright © 2014. All rights reserved.