Skip to main content

Audio

Audio widget allows you to play a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud, and DailyMotion.

How to use Audio Widget

Properties

Properties allow you to edit the widget, connect it with other widgets and customize the user actions.

Widget Properties

These properties allow you to edit the Audio widget. All of these properties are present in the property pane of the widget. The following table lists all the widget properties.

PropertyDescription
URLURL of the audio source to play.
Auto PlayPlays audio automatically on page load, without any action from the user.
VisibleControls the widget's visibility on the page. When turned off: The widget will not be visible when the app is published. It appears translucent when in Edit mode.
Animate LoadingWhen turned off, the widget will load without any skeletal animation. You can use a toggle switch to turn it on/off. You can also turn it off/on using JavaScript by clicking the JS label next to it and writing code that evaluates to a boolean.

Binding Properties

These properties allow you to bind your Audio widget with any other widget in queries or JS objects. The following table lists all the binding properties.

Binding PropertyDescription
autoPlayReflects the state of the widget's Auto Play setting (bool).
playStateShows whether the Audio widget is currently playing sound. Represented by a (string) with value "NOT_STARTED", "PLAYING", "PAUSED", or "ENDED".

Events

You can define functions that will be called when these events are triggered in the widget.

ActionDescription
onPlaySets the action to run when the audio begins playing. See a list of supported actions.
onPauseSets the action to run when the audio is paused. See a list of supported actions.
onEndSets the action to run when the audio ends. See a list of supported actions.