mediaframe.mpeg1
Class MPEG1

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--mediaframe.mpeg1.MPEG1
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.io.Serializable

public class MPEG1
extends java.applet.Applet
implements java.awt.event.MouseListener, java.awt.event.ActionListener

The class "MPEG1" is the main class of the MPEG1 Applet (Java MPEG inline player).

See Also:
Serialized Form

Field Summary
private  java.lang.String address
          The value of the "address" applet's parameter.
private  Player audio_decoder
          The audio player/decoder.
private  io_tool audio_stream
          The stream with only audio-frames.
private  boolean audioEnabled
          The state of the audio parameter of the applet
private  boolean autoPlay
          True if the applet should autoplay the movie.
 boolean buffered
          True if the buffering of the movie file has been finished.
private  boolean clickToPlay
          True if the applet should play the movie after clicking on the movie screen.
private  java.awt.image.DirectColorModel cm
          The RGB color model for the movie screen.
 IControlPanel controlPanel
          The control panel of the applet.
private  boolean correctLicense
          True if the player is used with the correct license key.
private  float current_volume
          The value of the current volume.
private  java.lang.String detect_location
          The location of the directory where the xx.detect.speed files are placed.
 int detected_speed
          Current internet connection bandwidth value (index for tables).
private  Element[] EL_ARR
          The array of Elements (objects that contain movie frames).
 boolean feedback_agent
          True if the applet should show the feedback information (speed detection, (re-)buffering).
 java.lang.String[] file_speeds
          Parameter names for the movie files that depend from the bandwidth value.
private  java.lang.String filename
          The name of the video file.
private  boolean firstAppletLoop
          True if the applet starts playback.
private  boolean firstLoop
          True if the applet should load the movie into the buffer, false if the movie already in the buffer.
 boolean float_controls
          True if applet's control panel should be showed only after rolloving above the movie screen.
private  int Frame_nr
          The last frame in "EL_ARR[]".
private  int h
          The height in MPEG stream.
private  java.awt.MenuItem idItem
          The "ID" popup menu item.
private  boolean initialized
          True if the set_dim() method was called by video_decoder.
private  MPEG_Reader input_reader
          The reader of the movie stream, contains both streams audio and video.
 int[] integer_speeds
          Possible bandwidth values supported by the applet.
private  java.lang.String key
          The license key value
private  int last_P_or_I
          Last P or I frame.
private  boolean licenseVerified
          True if the license is already verified.
private  boolean linux_platform
          True, if the current os is Linux.
private  java.lang.String lockedInfo
          The url of a web page with the description of the MEDIAFRAME LOCKED error.
private  int MAXELEMENT
          Number of "Element"s in "EL_ARR[]".
(package private)  java.awt.Image mf_logo
          The 'MediaFrame' ™ logo.
 MovieScreen movieScreen
          The panel on which the movie is shown.
private  io_tool mpeg_stream
          The stream with only video-frames.
private  boolean mute
          The mute sound state of the player (false if sound is on).
private  java.awt.MenuItem muteItem
          The "mute" popup menu item.
private  java.lang.String new_filename
          The file name of the movie which is used in the mediaframe_load javascript function
private  int o_h
          The original height in MPEG stream.
private  int o_w
          The original width in MPEG stream.
 boolean playbackLoop
          True if the applet should restart the playing after the playback is finished.
 boolean player_controls
          True if applet's control panel should be showed.
private  boolean playing
          True if the applet's state is PLAYED.
private  java.awt.MenuItem playItem
          The "Play" popup menu item.
(package private)  java.awt.PopupMenu popup
          The popup menu of the applet.
private  java.lang.String postScreen
          The value of the "postScreen" applet's parameter.
private  java.lang.String preScreen
          The value of the "preScreen" applet's parameter.
private  boolean readyToPlay
          True if the applet is ready to play the movie's first frame.
private  boolean rewinded
          True if the applet is rewinding the movie (tries to restart the playback from the begin after it is finished).
private  boolean rolloverToPlay
          True if the applet should play the movie after rolloving above the movie screen.
private  java.awt.MenuItem saveItem
          The "Save video as..." popup menu item.
private  java.lang.String saveScript
          The name of the script for the 'Save video as...' functionality
private  boolean saveVideoEnabled
          True if the 'Save video as...' functionality is enabled
 boolean show_controls
          True if applet's control panel is showed (has the meaning only if float_controls = true).
(package private)  boolean show_mf_logo
          Flag, equals true if 'MediaFrame' ™ logo is showing.
private  java.net.URL source_url
          The URL address of the movie file.
private  java.lang.String target
          The value of the "target" applet's parameter.
private  MPEG_video video_decoder
          The video decoder.
private  int video_length
          The length of the video file.
private  boolean video_license
          True if the license is stored in the video file.
private  int w
          The width in MPEG stream.
private  int window_x
          The width of the applet's movie screen.
private  int window_y
          The height of the applet's movie screen.
 
Fields inherited from class java.applet.Applet
 
Fields inherited from class java.awt.Panel
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MPEG1()
          Constructs the applet's object.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          This method is invoked when user selects the item of applet's popup menu.
private  long decrypt(long m, long d, long n)
          Decrypts the long value using the private key D and the public key N.
private  long decryptBlock()
          Decrypts one encrypted short value.
 void destroy()
          Destroys the player.
private  java.lang.String detectConnectionSpeed()
          Detects the speed of the internet connection.
 void endRebuffering(MPEG_Reader reader)
          Ends the "rebuffering" of the player.
 boolean get_audio_state()
          Returns the mute value of the audio player.
 int get_connection_speed()
          Gets the current connection speed.
 int get_errorcode()
          Returns the code of last error.
 java.lang.String get_filename()
          Gets the filename of the video file.
 java.lang.String get_mf_state()
          Returns the state of the player (buffering/ready/playing/paused/finished/error).
 int get_video_length()
          Stub for method that gets the length of the movie file in milliseconds.
 int get_video_size()
          Gets the length of the video file in bytes.
 int get_volume()
          Gets the current volume as an interger value (between 1>10).
 int get_volume(java.lang.String percent)
          If the percent equals '%' gets the current volume as a percent value (between 0..100) otherwise returns the volume as an interger value (between 1>10).
 Player getAudioPlayer()
          Gets the audio player/decoder object.
private  long getCRC32(java.lang.String str)
          Gets the crc32 checksum of the input string.
private  java.awt.Image getEmbeddedImage(java.lang.String image_path)
          Gets the image that embedded into applet's jar file by it's path.
private  java.awt.Image[] getImageFiles(java.lang.String fileName, java.lang.String fileRange)
          Gets the image files using the base filename and the fileRange parameters.
private  long getNextRecord(java.lang.String inputKey)
          Decrypts the one encrypted long value.
private  java.io.InputStream getZipStream(java.io.InputStream aIs)
          Opens and returns the InputStream for a zip-compressed file.
 void init()
          Inits the applet.
 boolean isCorrectLicense()
          Returns true if the license is correct.
private  boolean isCorrectLicenseKey(java.lang.String license_key)
          Verifies the license (license_key parameter) of the video player.
 boolean isLicenseVerified()
          Returns true if the license is already verified.
 boolean isSoundEnabled()
          Gets the state of the audio player.
 void mediaframe_load(java.lang.String fileName)
          Loads the new movie into the video player box.
 void mouseClicked(java.awt.event.MouseEvent e)
          Invoked when the mouse clicks on the applet's movie screen.
 void mouseEntered(java.awt.event.MouseEvent e)
          Invoked when the mouse enters the applet's movie screen area.
 void mouseExited(java.awt.event.MouseEvent e)
          Invoked when the mouse exits the applet's movie screen area.
 void mousePressed(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been pressed on the applet's movie screen.
 void mouseReleased(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been released from the applet's movie screen.
private  boolean open_url()
          Opens a movie file or a zip archive with a movie file for downloading and buffering.
private  void openTarget()
          Opens an address url in the target ("self", "blank", "top", etc) window.
private  float parseVolume(java.lang.String sVolume)
          Parses the volume level and returns it's float representation.
 void playerEnd(MPEG_video video)
          Is invoked after the movie playback is finished.
 void playerEndBuffer(MPEG_Reader reader)
          Is invoked after buffer is filled enough to start the movie playback (when the size of the buffered data equals or greater than the value specified by the "pre_buffer" applet's parameter).
private  void playerlooprewind()
          Rewinds the player to startup state after the movie playback is finished.
 void playerpause()
          Pauses the movie playback.
 void playerplay()
          Starts the movie playback.
 void playerrewind()
          Rewinds the player to the startup state.
 void playersetmute(boolean mute)
          Enable or disable speaker of the player.
 void playersetvolume(java.lang.String sVolume)
          Sets the volume level of the player.
 void playerStop()
          Stops the movie playback.
 void printBufferingPercent(MPEG_Reader reader, int percent)
          Prints the "buffering" percent.
 void set_dim(int width, int height, int o_width, int o_height)
          This method is necessary because the scanner must have the possibility to resize the applet and (possibly) the frame once he has recognized the dimensions of the MPEG frames.
 void set_Pixels(int[][] Pixels, int f_idx, int f_type, long pts, int Pic_rate)
          The method "set_Pixels" expects the pixel data, the type and number of the next frame in display order to change the pixel values of the next image.
private  void setMuteItemState(boolean mute)
          Sets the "mute" menu item state to 'On' or 'Off'
 void start()
          The method "start()" opens up the MPEG resource and produces and starts the "MPEG_Reader" thread.
 void startRebuffering(MPEG_Reader reader)
          Starts the "rebuffering" of the player.
 void stop()
          Stop the whole player.
 void update(java.awt.Graphics g)
          Stub, overwrites the "update()" method of Applet (does nothing).
private  void wait_rewind()
          Waits until the rewind action is finished.
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

h

private int h
The height in MPEG stream.


w

private int w
The width in MPEG stream.


o_h

private int o_h
The original height in MPEG stream.


o_w

private int o_w
The original width in MPEG stream.


firstAppletLoop

private boolean firstAppletLoop
True if the applet starts playback.


filename

private java.lang.String filename
The name of the video file.


video_length

private int video_length
The length of the video file.


last_P_or_I

private int last_P_or_I
Last P or I frame.


cm

private java.awt.image.DirectColorModel cm
The RGB color model for the movie screen.


Frame_nr

private int Frame_nr
The last frame in "EL_ARR[]".


MAXELEMENT

private final int MAXELEMENT
Number of "Element"s in "EL_ARR[]".

See Also:
Constant Field Values

EL_ARR

private Element[] EL_ARR
The array of Elements (objects that contain movie frames).


playing

private boolean playing
True if the applet's state is PLAYED.


mute

private boolean mute
The mute sound state of the player (false if sound is on).


mf_logo

java.awt.Image mf_logo
The 'MediaFrame' ™ logo.


show_mf_logo

volatile boolean show_mf_logo
Flag, equals true if 'MediaFrame' ™ logo is showing.


popup

java.awt.PopupMenu popup
The popup menu of the applet.


idItem

private java.awt.MenuItem idItem
The "ID" popup menu item.


playItem

private java.awt.MenuItem playItem
The "Play" popup menu item.


muteItem

private java.awt.MenuItem muteItem
The "mute" popup menu item.


saveItem

private java.awt.MenuItem saveItem
The "Save video as..." popup menu item.


controlPanel

public IControlPanel controlPanel
The control panel of the applet.


autoPlay

private boolean autoPlay
True if the applet should autoplay the movie.


clickToPlay

private boolean clickToPlay
True if the applet should play the movie after clicking on the movie screen.


rolloverToPlay

private boolean rolloverToPlay
True if the applet should play the movie after rolloving above the movie screen.


feedback_agent

public boolean feedback_agent
True if the applet should show the feedback information (speed detection, (re-)buffering).


target

private java.lang.String target
The value of the "target" applet's parameter.


address

private java.lang.String address
The value of the "address" applet's parameter.


preScreen

private java.lang.String preScreen
The value of the "preScreen" applet's parameter.


postScreen

private java.lang.String postScreen
The value of the "postScreen" applet's parameter.


player_controls

public boolean player_controls
True if applet's control panel should be showed.


float_controls

public boolean float_controls
True if applet's control panel should be showed only after rolloving above the movie screen.


show_controls

public boolean show_controls
True if applet's control panel is showed (has the meaning only if float_controls = true).


linux_platform

private boolean linux_platform
True, if the current os is Linux.


window_x

private int window_x
The width of the applet's movie screen.


window_y

private int window_y
The height of the applet's movie screen.


current_volume

private float current_volume
The value of the current volume.


firstLoop

private boolean firstLoop
True if the applet should load the movie into the buffer, false if the movie already in the buffer.


playbackLoop

public boolean playbackLoop
True if the applet should restart the playing after the playback is finished.


rewinded

private boolean rewinded
True if the applet is rewinding the movie (tries to restart the playback from the begin after it is finished).


readyToPlay

private boolean readyToPlay
True if the applet is ready to play the movie's first frame.


audioEnabled

private boolean audioEnabled
The state of the audio parameter of the applet


new_filename

private java.lang.String new_filename
The file name of the movie which is used in the mediaframe_load javascript function


correctLicense

private boolean correctLicense
True if the player is used with the correct license key.


licenseVerified

private boolean licenseVerified
True if the license is already verified.


video_license

private boolean video_license
True if the license is stored in the video file.


source_url

private java.net.URL source_url
The URL address of the movie file.


saveScript

private java.lang.String saveScript
The name of the script for the 'Save video as...' functionality


saveVideoEnabled

private boolean saveVideoEnabled
True if the 'Save video as...' functionality is enabled


mpeg_stream

private io_tool mpeg_stream
The stream with only video-frames.


audio_stream

private io_tool audio_stream
The stream with only audio-frames.


input_reader

private MPEG_Reader input_reader
The reader of the movie stream, contains both streams audio and video.


video_decoder

private MPEG_video video_decoder
The video decoder.


audio_decoder

private Player audio_decoder
The audio player/decoder.


detect_location

private java.lang.String detect_location
The location of the directory where the xx.detect.speed files are placed.


movieScreen

public MovieScreen movieScreen
The panel on which the movie is shown.


lockedInfo

private java.lang.String lockedInfo
The url of a web page with the description of the MEDIAFRAME LOCKED error.


detected_speed

public int detected_speed
Current internet connection bandwidth value (index for tables).

See Also:
file_speeds, integer_speeds

file_speeds

public java.lang.String[] file_speeds
Parameter names for the movie files that depend from the bandwidth value.


integer_speeds

public final int[] integer_speeds
Possible bandwidth values supported by the applet.


buffered

public boolean buffered
True if the buffering of the movie file has been finished.


initialized

private boolean initialized
True if the set_dim() method was called by video_decoder.


key

private java.lang.String key
The license key value

Constructor Detail

MPEG1

public MPEG1()
Constructs the applet's object.

Method Detail

detectConnectionSpeed

private final java.lang.String detectConnectionSpeed()
Detects the speed of the internet connection.

Returns:
the name of applet's parameter with a movie file for the detected bandwidth value.
Throws:
java.lang.Exception - raises if an error occurs.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
This method is invoked when user selects the item of applet's popup menu.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
event - event's data.

open_url

private boolean open_url()
Opens a movie file or a zip archive with a movie file for downloading and buffering. If necessary detects the internet connection bandwidth and chooses the right movie file.

Returns:
true if the file has been opened successfully.

init

public void init()
Inits the applet. Gets all values of applet's parameters, inits applet's control panel and downloads startup and end images.

Overrides:
init in class java.applet.Applet

getImageFiles

private java.awt.Image[] getImageFiles(java.lang.String fileName,
                                       java.lang.String fileRange)
Gets the image files using the base filename and the fileRange parameters. f.e. filename = preimage.gif, fileRange = 1-4, preimage1.gif ... preimage4.gif images should be downloaded. If the fileRange == null or incorrect value, the image with the fileName should be downloaded.

Parameters:
fileName - the base filename.
fileRange - the range of the files.
Returns:
the array of images that have been loaded.

start

public void start()
The method "start()" opens up the MPEG resource and produces and starts the "MPEG_Reader" thread. Creates both video and audio stream, audio and video decoder.

Overrides:
start in class java.applet.Applet

stop

public void stop()
Stop the whole player.

Overrides:
stop in class java.applet.Applet

get_filename

public java.lang.String get_filename()
Gets the filename of the video file.

Returns:
the filename of the video file.

get_video_size

public int get_video_size()
Gets the length of the video file in bytes.

Returns:
the length of the video file.

get_video_length

public int get_video_length()
Stub for method that gets the length of the movie file in milliseconds.

Returns:
-1.

get_audio_state

public boolean get_audio_state()
Returns the mute value of the audio player.

Returns:
the mute value of the audio player.

get_errorcode

public int get_errorcode()
Returns the code of last error.

Returns:
the code of last error.

get_mf_state

public java.lang.String get_mf_state()
Returns the state of the player (buffering/ready/playing/paused/finished/error).

Returns:
the state of the player (buffering/ready/playing/paused/finished/error).

destroy

public void destroy()
Destroys the player.

Overrides:
destroy in class java.applet.Applet

playerplay

public void playerplay()
Starts the movie playback.


playerEndBuffer

public void playerEndBuffer(MPEG_Reader reader)
Is invoked after buffer is filled enough to start the movie playback (when the size of the buffered data equals or greater than the value specified by the "pre_buffer" applet's parameter).

Parameters:
reader - the MPEG_Reader object ("MPEG_Reader" thread owner).

startRebuffering

public void startRebuffering(MPEG_Reader reader)
Starts the "rebuffering" of the player.

Parameters:
reader - the reader thread.

endRebuffering

public void endRebuffering(MPEG_Reader reader)
Ends the "rebuffering" of the player.

Parameters:
reader - the reader thread.

printBufferingPercent

public void printBufferingPercent(MPEG_Reader reader,
                                  int percent)
Prints the "buffering" percent.

Parameters:
reader - the MPEG_Reader object ("MPEG_Reader" thread owner).
percent - the "buffering" percent value.

playerpause

public void playerpause()
Pauses the movie playback.


playerStop

public void playerStop()
Stops the movie playback.


playerEnd

public void playerEnd(MPEG_video video)
Is invoked after the movie playback is finished.

Parameters:
video - the MPEG_Reader object ("MPEG_Reader" thread owner).

wait_rewind

private void wait_rewind()
Waits until the rewind action is finished.


playerlooprewind

private void playerlooprewind()
Rewinds the player to startup state after the movie playback is finished. This method could be invoked only if playbackLoop = true.


playerrewind

public void playerrewind()
Rewinds the player to the startup state.


setMuteItemState

private void setMuteItemState(boolean mute)
Sets the "mute" menu item state to 'On' or 'Off'

Parameters:
mute - the mute value.

playersetmute

public void playersetmute(boolean mute)
Enable or disable speaker of the player.

Parameters:
mute - mute value (true - disable sound, false - enable sound).

mediaframe_load

public void mediaframe_load(java.lang.String fileName)
Loads the new movie into the video player box.

Parameters:
fileName - the movie file name.

get_connection_speed

public int get_connection_speed()
Gets the current connection speed.

Returns:
the current connection speed.

get_volume

public int get_volume()
Gets the current volume as an interger value (between 1>10).

Returns:
the current volume as an interger value (between 1>10).

get_volume

public int get_volume(java.lang.String percent)
If the percent equals '%' gets the current volume as a percent value (between 0..100) otherwise returns the volume as an interger value (between 1>10).

Parameters:
percent - the type of the requested value (equals '%' for the percent type).
Returns:
the current volume as a percent or an integer value.

playersetvolume

public void playersetvolume(java.lang.String sVolume)
Sets the volume level of the player. Accepts either an interger (between 1>10) or a percent (x%) value.

Parameters:
sVolume - the volume level.

parseVolume

private float parseVolume(java.lang.String sVolume)
Parses the volume level and returns it's float representation.

Parameters:
sVolume - the volume level in percent (100%..0%) or integer (10..1) form.
Returns:
the float value of the volume in the range 1..0.

isSoundEnabled

public boolean isSoundEnabled()
Gets the state of the audio player.

Returns:
true if the audio player is able to play the sound.

set_dim

public void set_dim(int width,
                    int height,
                    int o_width,
                    int o_height)
This method is necessary because the scanner must have the possibility to resize the applet and (possibly) the frame once he has recognized the dimensions of the MPEG frames. This method is called by the "MPEG_Reader".

Parameters:
width - the width in MPEG stream.
height - the height in MPEG stream.
o_width - the original width in MPEG stream.
o_height - the original height in MPEG stream.

set_Pixels

public void set_Pixels(int[][] Pixels,
                       int f_idx,
                       int f_type,
                       long pts,
                       int Pic_rate)
                throws java.lang.InterruptedException
The method "set_Pixels" expects the pixel data, the type and number of the next frame in display order to change the pixel values of the next image. It determins the number of the next frame in display order (which differes from coding order) and passes it to the MovieScreen by means of the "Dispatcher".

Parameters:
Pixels - the array of pixels as YUV values.
f_idx - the frame number in the movie.
f_type - the type of the frame.
pts - the time in milliseconds that this frame is to be displayed.
Pic_rate - the frame rate code.
Throws:
java.lang.InterruptedException - if another process interrupts this thread.

update

public void update(java.awt.Graphics g)
Stub, overwrites the "update()" method of Applet (does nothing).

Overrides:
update in class java.awt.Container
Parameters:
g - the graphics context to paint.

getAudioPlayer

public Player getAudioPlayer()
Gets the audio player/decoder object.

Returns:
the audio player/decoder object.

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on the applet's movie screen.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
e - the event's data.

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released from the applet's movie screen.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
e - the event's data.

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse clicks on the applet's movie screen.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
e - the event's data.

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters the applet's movie screen area.

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
e - the event's data.

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits the applet's movie screen area.

Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
e - the event's data.

openTarget

private void openTarget()
Opens an address url in the target ("self", "blank", "top", etc) window.


getZipStream

private java.io.InputStream getZipStream(java.io.InputStream aIs)
                                  throws java.lang.Exception
Opens and returns the InputStream for a zip-compressed file.

Parameters:
aIs - the InputStream of the zip file.
Returns:
the InputStream of the zip-compressed file.
Throws:
java.lang.Exception - if an I/O error occurs.

isCorrectLicenseKey

private boolean isCorrectLicenseKey(java.lang.String license_key)
Verifies the license (license_key parameter) of the video player.

Returns:
true if the license is correct.

getNextRecord

private long getNextRecord(java.lang.String inputKey)
Decrypts the one encrypted long value.

Parameters:
inputKey - input key value (null if an old value should be used).
Returns:
decrypted value.

decryptBlock

private long decryptBlock()
Decrypts one encrypted short value.

Returns:
decrypted value.

decrypt

private long decrypt(long m,
                     long d,
                     long n)
Decrypts the long value using the private key D and the public key N.

Parameters:
m - the long value that must be decrypted.
d - the private key D.
n - the public key N.
Returns:
decrypted value.

getCRC32

private long getCRC32(java.lang.String str)
Gets the crc32 checksum of the input string.

Parameters:
str - the input string.
Returns:
the crc32 checksum.

isCorrectLicense

public boolean isCorrectLicense()
Returns true if the license is correct.

Returns:
true if the license is correct.

isLicenseVerified

public boolean isLicenseVerified()
Returns true if the license is already verified.

Returns:
true if the license is already verified.

getEmbeddedImage

private java.awt.Image getEmbeddedImage(java.lang.String image_path)
Gets the image that embedded into applet's jar file by it's path.

Parameters:
image_path - the path to the resource image.
Returns:
the image which was loaded.