sears.tools.player
Class DefaultPlayer

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

public class DefaultPlayer
extends java.lang.Object
implements PlayerInterface

Class DefaultPlayer.
Summary:
That is the default player, which permit to launch a player on a video file and a subtitle file.


Constructor Summary
DefaultPlayer()
           
 
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)
           
 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
 

Constructor Detail

DefaultPlayer

public DefaultPlayer()
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

goToOffset

public void goToOffset(int offset)
                throws PlayerException
Throws:
PlayerException

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. return -1 if video is currently stopped;

Specified by:
getPosition in interface PlayerInterface
Throws:
PlayerException

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). return -1 if video is currently stopped;

Specified by:
getLength in interface PlayerInterface
Throws:
PlayerException

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

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

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