es.upm.dit.multimedia.piplayer.playerfactory
Interface COBRAPlayer

All Known Implementing Classes:
VLCPlayer

public interface COBRAPlayer

COBRAPlayer interface

Author:
Jose Luis Ruiz, Rodrigo Garcia

Method Summary
 void fullScreen()
          Toggles the full screen function of the player.
 long getLength()
           
 float getPosition()
           
 long getTime()
           
 java.lang.Object getUIComponent()
          The visual component needs to be downcasted to specific GUI library.
 int getVolume()
           
 boolean hasVisualComponent()
           
 boolean isPlaying()
           
 void mute()
          Toggles the mute function of the player
 void pause()
          Pauses the player
 void setPosition(float position)
          Sets the current position in the media between 0 and 1 (%)
 void setTime(long time)
          Sets the current time in the media in milliseconds
 void setVolume(int volume)
          Sets the current volume in a scale between 0 and 100
 void start()
          Starts the player
 void stop()
          Stops the player
 

Method Detail

start

void start()
           throws java.lang.Exception

Starts the player

Throws:
java.lang.Exception

stop

void stop()
          throws java.lang.Exception

Stops the player

Throws:
java.lang.Exception

pause

void pause()
           throws java.lang.Exception

Pauses the player

Throws:
java.lang.Exception

getUIComponent

java.lang.Object getUIComponent()
                                throws java.lang.Exception
The visual component needs to be downcasted to specific GUI library. For example, if AWT is used, the returned object will be -at least- of type java.awt.Component.

Returns:
A GUI-dependent visual component if exists.
Throws:
java.lang.Exception - if there is no available visual component

hasVisualComponent

boolean hasVisualComponent()
Returns:
true if this player has got a visual component

fullScreen

void fullScreen()
                throws java.lang.Exception
Toggles the full screen function of the player. Only works if the video has been started and has a visual component

Throws:
java.lang.Exception

getLength

long getLength()
               throws java.lang.Exception
Returns:
the length of the media in milliseconds
Throws:
java.lang.Exception

getPosition

float getPosition()
                  throws java.lang.Exception
Returns:
the current position in the media between 0 and 1 (%)
Throws:
java.lang.Exception

getTime

long getTime()
             throws java.lang.Exception
Returns:
the current position in the media in milliseconds
Throws:
java.lang.Exception

setPosition

void setPosition(float position)
                 throws java.lang.Exception
Sets the current position in the media between 0 and 1 (%)

Throws:
java.lang.Exception

setTime

void setTime(long time)
             throws java.lang.Exception
Sets the current time in the media in milliseconds

Throws:
java.lang.Exception

mute

void mute()
          throws java.lang.Exception
Toggles the mute function of the player

Throws:
java.lang.Exception

getVolume

int getVolume()
              throws java.lang.Exception
Returns:
the current volume in a scale between 0 and 100
Throws:
java.lang.Exception

setVolume

void setVolume(int volume)
               throws java.lang.Exception
Sets the current volume in a scale between 0 and 100

Throws:
java.lang.Exception

isPlaying

boolean isPlaying()