The AudioPlayer widget allows the end user to control audio playback, including volume, seeking, and pause/resume playback.


  • UI Type:

Extends: BaseWidget

Properties

Name Desciption
DisabledThe widget cannot be used.
HiddenHides the widget from the user.
soundThe link of the audio/wav file(to be added in the resources first) to be played.
Tab IndexThe Tab Index is an integer that tells the order of the widget when using the tab-key to move from one widget to another.

Style

Name Desciption
Align buttonsDefines the alignment of Play and Stop buttons, along the main axis(horizontal).
Background-colorChange the background color of the widget.
Button backgroundSets the background color of the Play and Stop buttons.
Button HeightSets the heights of the Play and Stop buttons.
Button left/right spacingSets the left and right padding of the Play and Stop buttons within the Sound widget.
Button radiusAdd rounded corners to the Play and Stop buttons.
Button top/bottom spacingSets the top and bottom padding of the Play and Stop buttons within the Sound widget.
Button WidthSets the width of the Play and Stop buttons.
ColorColor of the text inside the widgets. May not apply to all text inside all widgets.
Font SizeSet the font size in pixels for text.
Text-alignmentSet left, centered or right. Applies both to icon and text.

Events

Name Description Event Attribute
Blur Event when a widget goes out of focus
event The event that gets triggered when the user "leaves" an element.
Click Event that triggers based on touch or click.
event The event that triggered the handler.
DblClick Event that triggers based on double click.
event The event that triggered the handler.
Focus Event when indicating/ highlighting widget using the cursor.
event Focus is the event that gets triggered when a user makes an element come into focus, by clicking on it.

Function

blur ( )

It triggers the blur event of the widget.

focus ( )

It triggers the focus event of the widget.

get(name) ( )

Returns the value of specified property. ‘name’ is a string and it refers to the property name.

set(name, value) ( )

Sets the value of specified property. ‘name’ is a string and it refers to property name and ‘value’ is a string and it refers to new value.

hide() ( )

Hides the widget.

show() ( )

Shows the widget.

getId() ( )

Returns the Id of the widget.

getValue() ( )

Returns value set by setValue().

setValue(value) ( )

Sets the values of the widget. Does nothing to the audio.

isEnabled() ( )

Returns true if widget is enabled.

isHidden() ( )

Returns true if the widget is hidden.

setEnabled() ( )

Enables/disables the widget.’Enabled’ is boolean and if it's true then the widget is enabled and disabled if false.

setStyle(Object) ( )

Sets the widget style. It will override the styling applied to the widget.

play() ( )

It plays the audio or unpauses the audio.

pause() ( )

It pauses the audio.

stop() ( )

It stops the audio and resets the audio to 00:00.

scrollTo(value) ( )

A new addon which helps to make the element visible by scrolling the view to that specific widget.