org.gstreamer.media
Class PlayBinMediaPlayer

java.lang.Object
  extended by org.gstreamer.media.AbstractMediaPlayer
      extended by org.gstreamer.media.PipelineMediaPlayer
          extended by org.gstreamer.media.PlayBinMediaPlayer
All Implemented Interfaces:
MediaPlayer

public class PlayBinMediaPlayer
extends PipelineMediaPlayer

Basic implementation of a MediaPlayer


Field Summary
 
Fields inherited from class org.gstreamer.media.PipelineMediaPlayer
pipeline
 
Fields inherited from class org.gstreamer.media.AbstractMediaPlayer
eventExecutor, playList
 
Constructor Summary
PlayBinMediaPlayer()
           
PlayBinMediaPlayer(java.lang.String name, java.util.concurrent.Executor eventExecutor)
           
 
Method Summary
 double getVolume()
          Gets the current audio output volume.
 boolean isPlaying()
          Tests if this media player is currently playing a media file.
protected static java.net.URI parseURI(java.lang.String uri)
          Parses the URI in the String.
 void pause()
          Pauses playback of a media file.
 void play()
          Starts or resumes playback of a media file.
 void setAudioSink(Element sink)
          Sets the sink element to use for audio output.
 void setInputFile(java.io.File file)
          Sets the current file to play.
 void setURI(java.net.URI uri)
          Sets the media file to play.
 void setVideoSink(Element sink)
          Sets the sink element to use for video output.
 void setVolume(double volume)
          Sets the audio output volume.
 void stop()
          Stops playback of a media file.
 
Methods inherited from class org.gstreamer.media.PipelineMediaPlayer
addMediaListener, getPipeline, removeMediaListener
 
Methods inherited from class org.gstreamer.media.AbstractMediaPlayer
enqueue, enqueue, fireEndOfMediaEvent, firePauseEvent, fireStartEvent, fireStopEvent, getMediaListeners, remove, setPlaylist
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlayBinMediaPlayer

public PlayBinMediaPlayer(java.lang.String name,
                          java.util.concurrent.Executor eventExecutor)

PlayBinMediaPlayer

public PlayBinMediaPlayer()
Method Detail

setAudioSink

public void setAudioSink(Element sink)
Sets the sink element to use for audio output.

Parameters:
sink - The sink to use for audio output.

setVideoSink

public void setVideoSink(Element sink)
Sets the sink element to use for video output.

Parameters:
sink - The sink to use for video output.

isPlaying

public boolean isPlaying()
Tests if this media player is currently playing a media file.

Returns:
true if a media file is being played.

pause

public void pause()
Pauses playback of a media file.


play

public void play()
Starts or resumes playback of a media file.


stop

public void stop()
Stops playback of a media file.


setURI

public void setURI(java.net.URI uri)
Sets the media file to play.

Parameters:
uri - The URI that describes the location of the media file.

setInputFile

public void setInputFile(java.io.File file)
Sets the current file to play.

Parameters:
file - the File to play.

setVolume

public void setVolume(double volume)
Sets the audio output volume.

Parameters:
volume - a number between 0.0 and 1.0 representing the percentage of the maximum volume.

getVolume

public double getVolume()
Gets the current audio output volume.

Returns:
a number between 0.0 and 1.0 representing the percentage of the maximum volume.

parseURI

protected static java.net.URI parseURI(java.lang.String uri)
Parses the URI in the String.

This method will check if the uri is a file and return a valid URI for that file.

Parameters:
uri - the string representation of the URI.
Returns:
a URI