PlayControl Class

Used to render a slider that can be used a part of a audio or video controller. This class builds upon the javaxt.dhtml.Slider class by providing basic functions like play, pause, and stop. However, this class does not provide any buttons or any other components to perform these operations - this is just a fancy slider :-) Users can interact with the slider while its running and get back elapsed time.

Constructors

PlayControl( parent, config )
Used to instantiate this class
parentDOM element in which to render this component
configConfiguration settings (optional). See config options for more information.

Config Options

startTime
Used to specify the start time, in seconds. Default is 0.
speed
Refresh rate, in seconds. Default is 0.2.
totalTime
Used to specify the total run time, in seconds. Default is 60.
style
Style for individual elements within the component. Uses the style defined in the javaxt.dhtml.Slider class by default.

Events

onChange( elapsedTime )
Called whenever the player is updated.
onEnd( )
Called whenever the elapsed time equals the total run time.

Public Methods

setRunTime( runTime )
Used to update the total run time. This value is originally set in the config settings (see totalTime).
runTimeTotal run time, in seconds
play( _loop )
Used to start the player
pause( )
Used to pause the player.
stop( )
Used to stop the player and set the start time to 0 seconds.
isPlaying( )
Returns true if the player is playing.
getElapsedTime( )
setElapsedTime( elapsedTime )
Used to update the elapsed time time.
elapsedTimeTime in seconds