sears.tools.player
Class VLCPlayer

java.lang.Object
  extended by sears.tools.player.VLCPlayer
All Implemented Interfaces:
PlayerInterface

public class VLCPlayer
extends java.lang.Object
implements PlayerInterface

Class VLCPlayer.
Summary:
This class implements the PlayerInterface, and is designed to control the vlc software. VLC is controled through its http server mode. You can found vlc at http://www.videolan.org/

Author:
David DEBARGE

Field Summary
static java.lang.String DEFAULT_VLC_PATH_LINUX
          default VLC path in Window os
static java.lang.String DEFAULT_VLC_PATH_MAC
          default VLC path on Mac OS X os
static java.lang.String DEFAULT_VLC_PATH_WINDOWS
          default VLC path in Linux os
static java.lang.String DEFAULT_VLC_RESTART
          The default VLC restart parameter
static java.lang.String vlcParameter
          The VLC parameter which is used to exec VLC player
 
Constructor Summary
VLCPlayer()
          Method constructor.
VLCPlayer(java.lang.String hostName, int portNumber)
          Method constructor.
 
Method Summary
 int getLength()
          Method getLength Summary: This method permit to get the video time length(in seconds).
 int getPosition()
          Method getPosition Summary: This method permit to get the current position (in seconds) in the video.
 void goToOffset(int offset)
          Empty method
 void pause()
          Method pause Summary: Pause the video.
 void play(java.lang.String videoFile, java.lang.String subtitleFile)
          Method play Summary: Use it to launch a video, with its subtitles.
 void quit()
          Method quit Summary: This method allows to kill the player.
 void setPosition(int offset)
          Method setPosition Summary: This method permit to shift to the correct offset (in s) in the video.
 void stop()
          Method stop Summary: stop the video.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vlcParameter

public static java.lang.String vlcParameter
The VLC parameter which is used to exec VLC player


DEFAULT_VLC_RESTART

public static final java.lang.String DEFAULT_VLC_RESTART
The default VLC restart parameter

See Also:
Constant Field Values

DEFAULT_VLC_PATH_MAC

public static final java.lang.String DEFAULT_VLC_PATH_MAC
default VLC path on Mac OS X os

See Also:
Constant Field Values

DEFAULT_VLC_PATH_LINUX

public static final java.lang.String DEFAULT_VLC_PATH_LINUX
default VLC path in Window os

See Also:
Constant Field Values

DEFAULT_VLC_PATH_WINDOWS

public static final java.lang.String DEFAULT_VLC_PATH_WINDOWS
default VLC path in Linux os

See Also:
Constant Field Values
Constructor Detail

VLCPlayer

public VLCPlayer(java.lang.String hostName,
                 int portNumber)
          throws PlayerException
Method constructor.
Summary:
The class constructor

Parameters:
hostName - The String hostname to connect to VLC
portNumber - The int port number to connect to VLC
Throws:
PlayerException - if an error occurs

VLCPlayer

public VLCPlayer()
          throws PlayerException
Method constructor. The class constructor using the default value of hostName and portNumber to connect to VLC
Summary:

Throws:
PlayerException - if an error occurs
Method Detail

play

public void play(java.lang.String videoFile,
                 java.lang.String subtitleFile)
          throws PlayerException
Description copied from interface: PlayerInterface
Method play Summary: Use it to launch a video, with its subtitles. Or to resume from pause.

Specified by:
play in interface PlayerInterface
Parameters:
videoFile - The path to the videoFile.
subtitleFile - The path to the subtitleFile.
Throws:
PlayerException - if an error occurs

goToOffset

public void goToOffset(int offset)
                throws PlayerException
Empty method

Parameters:
offset - the offset
Throws:
PlayerException - if an error occurs

quit

public void quit()
Description copied from interface: PlayerInterface
Method quit Summary: This method allows to kill the player.

Specified by:
quit in interface PlayerInterface

getPosition

public int getPosition()
                throws PlayerException
Description copied from interface: PlayerInterface
Method getPosition Summary: This method permit to get the current position (in seconds) in the video.

Specified by:
getPosition in interface PlayerInterface
Returns:
the current position in the video or -1 if video is currently stopped;
Throws:
PlayerException - if an error occurs

getLength

public int getLength()
              throws PlayerException
Description copied from interface: PlayerInterface
Method getLength Summary: This method permit to get the video time length(in seconds).

Specified by:
getLength in interface PlayerInterface
Returns:
the video time length or -1 if video is currently stopped;
Throws:
PlayerException - if an error occurs

pause

public void pause()
           throws PlayerException
Description copied from interface: PlayerInterface
Method pause Summary: Pause the video. Or to resume from previous pause.

Specified by:
pause in interface PlayerInterface
Throws:
PlayerException - if an error occurs

stop

public void stop()
          throws PlayerException
Description copied from interface: PlayerInterface
Method stop Summary: stop the video.

Specified by:
stop in interface PlayerInterface
Throws:
PlayerException - if an error occurs

setPosition

public void setPosition(int offset)
                 throws PlayerException
Description copied from interface: PlayerInterface
Method setPosition Summary: This method permit to shift to the correct offset (in s) in the video.

Specified by:
setPosition in interface PlayerInterface
Parameters:
offset - The offset in the video to go.
Throws:
PlayerException - if an error occurs