net.jinx.media
Class VideoPlayer

java.lang.Object
  extended by net.jinx.media.VideoPlayer
Direct Known Subclasses:
MPlayer

public abstract class VideoPlayer
extends java.lang.Object


Constructor Summary
VideoPlayer()
           
 
Method Summary
static VideoPlayer getDefaultPlayer()
          Constructs a new VideoPlayer, using sane defaults, progressively falling back on worse and worse VideoPlayer implementations, until one of them works.
 java.io.OutputStream getLogStream()
          Provides the OutputStream that diagnostic data from this VideoPlayer will be sent to.
 boolean isFullscreen()
          Provides a way to check if this VideoPlayer will attempt to play it's videos in full screen mode.
abstract  void playVideo(java.io.File file)
          Plays a video file, returning when the video player has finished.
protected static java.io.File searchPath(java.lang.String name)
           
protected static java.io.File searchPath(java.lang.String name, java.io.File[] excludeDirs)
           
 void setFullscreen(boolean fs)
          Allows setting the state this VideoPlayer should play it's videos in.
 void setLogStream(java.io.OutputStream out)
          Sets the OutputStream that should be used for diagnostic output from this VideoPlayer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VideoPlayer

public VideoPlayer()
Method Detail

playVideo

public abstract void playVideo(java.io.File file)
                        throws java.io.IOException
Plays a video file, returning when the video player has finished. This method should be synchronized.

Parameters:
file - the File to play. This should reference a video file, but some VideoPlayer implementations may be capable of playing other things. For example, MPlayer is a generalized media player, so it should play music, too.
Throws:
java.io.IOException - if an I/O error occurs while playing or attempting to play the video.

setFullscreen

public void setFullscreen(boolean fs)
Allows setting the state this VideoPlayer should play it's videos in.

Parameters:
fs - if true, then the player will play the file full screen mode if at all possible. If false, then it will attempt to play the file in windowed mode.

isFullscreen

public boolean isFullscreen()
Provides a way to check if this VideoPlayer will attempt to play it's videos in full screen mode.

Returns:
true if full screen mode will be attempted, false otherwise. This defaults to true.

setLogStream

public void setLogStream(java.io.OutputStream out)
Sets the OutputStream that should be used for diagnostic output from this VideoPlayer. The default stream simply ignores all data sent through it.

Parameters:
out - the OutputStream. If this is null, the default stream will be used.

getLogStream

public java.io.OutputStream getLogStream()
Provides the OutputStream that diagnostic data from this VideoPlayer will be sent to. The default stream simply ignores all data sent through it.

Returns:
the OutputStream.

getDefaultPlayer

public static VideoPlayer getDefaultPlayer()
Constructs a new VideoPlayer, using sane defaults, progressively falling back on worse and worse VideoPlayer implementations, until one of them works.

Returns:
a valid VideoPlayer, or null if none could be constructed.

searchPath

protected static java.io.File searchPath(java.lang.String name)

searchPath

protected static java.io.File searchPath(java.lang.String name,
                                         java.io.File[] excludeDirs)