Zimlet JavaScript API Reference - DwtSoundPlugin

Class DwtSoundPlugin


Extends DwtControl.

This class represents a widget that plays sounds. It uses a plugin such as Quick Time or Windows Media to play the sounds and to display player controls. Do not invoke the constructor directly. Instead use the create() method, which will choose the right concrete class based on available plugins.

Defined in: DwtSoundPlugin.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
DwtSoundPlugin(params)
Creates a sound plugin control.
Field Summary
Field Attributes Field Name and Description
<static>  
DwtSoundPlugin.MAX_VOLUME
Defines the "max" volume.
Method Summary
Method Attributes Method Name and Description
 
Adds a change listener to monitor the status of the sound being played.
<static>  
DwtSoundPlugin.create(params)
Factory method.
<static>  
DwtSoundPlugin.isPluginMissing()
Checks if the plugin is missing.
<static>  
DwtSoundPlugin.isScriptingBroken()
Checks if scripting is broken.
 
Pauses the sound.
 
play()
Plays the sound.
 
Rewinds the sound.
 
setTime(time)
Sets the current time in milliseconds.
 
setVolume(volume)
Sets the volume.
Methods borrowed from class DwtControl:
addClassName, addControlListener, addDisposeListener, addListener, appendElement, blur, clearContent, clearHandler, condClassName, delClassName, dispose, focus, getBounds, getClassName, getContent, getCursor, getData, getDragBox, getDragSource, getDropTarget, getEnabled, getFocusElement, getH, getHtmlElement, getHTMLElId, getInsetBounds, getInsets, getLocation, getMargins, getOpacity, getOuterSize, getPosition, getScrollContainer, getScrollStyle, getSize, getTabGroupMember, getTooltipBase, getToolTipContent, getVisibility, getVisible, getW, getX, getXW, getY, getYH, getZIndex, hasFocus, isAlertShown, isDisposed, isInitialized, isListenerRegistered, notifyListeners, preventContextMenu, preventSelection, removeAllListeners, removeControlListener, removeDisposeListener, removeListener, reparent, reparentHtmlElement, replaceElement, setBounds, setClassName, setContent, setCursor, setData, setDisplay, setDisplayState, setDragBox, setDragSource, setDropTarget, setEnabled, setEventPropagation, setFocusElement, setHandler, setHtmlElementId, setLocation, setOpacity, setPosition, setScrollStyle, setSize, setToolTipContent, setVisibility, setVisible, setZIndex, showAlert, zShow
Class Detail
DwtSoundPlugin(params)
Creates a sound plugin control.
Parameters:
{hash} params
a hash of parameters
{DwtControl} params.parent
the parent widget
{number} params.width
the width of player
{number} params.height
the height of player
{number} params.volume
volume on a scale of 0 - DwtSoundPlugin.MAX_VOLUME
{string} params.url
{String} the sound url
{boolean} params.offscreen Optional
{Boolean} if true, the player is initially offscreen. Use an appropriate position style if you set this to true. (This reduces flicker, and a tendency for the QT player to float in the wrong place when it's first created)
{string} params.className Optional
the CSS class
{constant} params.posStyle Optional, Default: DwtControl.STATIC_STYLE
the positioning style (see DwtControl)
Field Detail
<static> DwtSoundPlugin.MAX_VOLUME
Defines the "max" volume.
Method Detail
addChangeListener(listener)
Adds a change listener to monitor the status of the sound being played. The listener will be passed an event object with the following fields:
  • status, a constant representing the loaded state of the sound
  • duration, the length of the sound
  • time, the current time of the sound
Parameters:
{AjxListener} listener
the listener

<static> DwtSoundPlugin.create(params)
Factory method. Creates an appropriate sound player for whatever plugins are or are not installed.
Parameters:
{hash} params
a hash of parameters
{DwtControl} params.parent
the parent widget
{number} params.width
the width of player
{number} params.height
the height of player
{number} params.volume
volume on a scale of 0 - DwtSoundPlugin.MAX_VOLUME
{string} params.url
{String} the sound url
{boolean} params.offscreen Optional
{Boolean} if true, the player is initially offscreen. Use an appropriate position style if you set this to true. (This reduces flicker, and a tendency for the QT player to float in the wrong place when it's first created)
{string} params.className Optional
the CSS class
{constant} params.posStyle Optional, Default: DwtControl.STATIC_STYLE
the positioning style (see DwtControl)

<static> {boolean} DwtSoundPlugin.isPluginMissing()
Checks if the plugin is missing.
Returns:
{boolean} true if plugin is missing

<static> {boolean} DwtSoundPlugin.isScriptingBroken()
Checks if scripting is broken.
Returns:
{boolean} true if scripting is broken

pause()
Pauses the sound.

play()
Plays the sound.

rewind()
Rewinds the sound.

setTime(time)
Sets the current time in milliseconds.
Parameters:
{number} time
the time (in milliseconds)

setVolume(volume)
Sets the volume.
Parameters:
{number} volume
the volume
See:
DwtSoundPlugin.MAX_VOLUME

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:29 GMT-0400 (EDT)