SOLFIND
Web Lens
Portal home

Audio | Appsmith

https://docs.appsmith.com/reference/widgets/audio • 70 KB fetched
Open original page


Audio | Appsmith

Skip to main content

Ask AI
Search

Ask Appsmith AI Submit message

Examples How do I install Appsmith using Docker? How do I connect to my local PostgreSQL database? How do I pass inputs from a widget to a query? How do I trigger multiple queries conditionally? How do I fix the error: This value does not evaluate to type Array<Object>?

Search

Try Appsmith

* Get Started

* Introduction

* Build Your First App

* Self Hosting

* New Installation Guides

* Manage Installation

* Upgrade Installation Guides

* Concepts

* Connect Data

* Overview

* How-to Guides

* Reference

* Datasources

* Query Settings

* Concepts

* Build Apps

* Overview

* Quickstart

* How-to Guides

* Reference

* Widgets

* Audio

* Audio Recorder

* Button

* Button Group

* Camera

* Card

* Category Slider

* Chart

* Checkbox

* Checkbox Group

* Code Scanner

* Container

* Currency Input

* Custom

* Datepicker

* Divider

* Document Viewer

* Form

* Filepicker

* Icon Button

* Iframe

* Image

* Input

* JSON Form

* List

* Map

* Map Chart

* Menu Button

* Modal

* MultiSelect

* Multi TreeSelect

* Number Slider

* Phone Input

* Progress

* Radio Group

* Range Slider

* Rating

* Rich Text Editor

* Select

* Stats Box

* Switch

* Switch Group

* Tabs

* Table

* Text

* TreeSelect

* Video

* Accessibility

* Theme

* Sample Apps

* Write Code

* Overview

* How-to Guides

* Reference

* Global Objects

* Global Functions

* JS Libraries

* Fetch API

* Data Transformation

* JavaScript Settings

* Concepts

* Best Practices

* Manage Apps and Users

* Authentication

* Granular Access Control

* Versioning with Git

* Setup SCIM Provisioning

* Embed Appsmith

* Migrate Applications

* Audit Logs

* Branding

* External Client Portal

* Packages

* Overview

* Tutorial

* How-to Guides

* Reference

* Package Version Control

* GIT Apps with Packages Best Practices

* Code Packages

* UI Packages

* Workflows

* Overview

* Tutorial

* How-to Guides

* Reference

* Workflow Triggers

* Workflow Queries

* Workflow Functions

* Pass Parameters to Workflows

* Run History

* Troubleshooting

* Overview

* Self-hosting Errors

* Application Errors

* Product

* FAQ

* Security

* Telemetry

* Support at Appsmith

* Privacy Policy

* Release Notes

* Contribute

© 2026 Appsmith, Inc.

*

* Build Apps

* Reference

* Widgets

* Audio
On this page
Audio

This page provides information on using the Audio widget to play MP3, WAV, OGG audio files. It also supports URLs from YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud, and DailyMotion.

Using the Audio Widget
Content properties ​

These properties are customizable options present in the property pane of the widget, allowing users to modify the widget according to their preferences.

Data ​

URL string ​

Allows you to set the audio source to be played. It supports various formats such as MP3, WAV, and OGG.
Example :
https : / / assets . appsmith . com / widgets / birds_chirping . mp3

You can display dynamic data by binding the response from a query or a JavaScript function to the URL property. For instance, if you have a table with a column containing audio URLs, clicking on a specific row plays the corresponding audio:
Example :
{ { Table1 . selectedRow . audioURL } }

General ​

Auto Play boolean ​

Enables the audio to play automatically on page load, without requiring any action from the user. Default value is false .

Visible boolean ​

Controls the visibility of the widget. If you turn off this property, the widget would not be visible in View Mode. Additionally, you can use JavaScript by clicking on JS next to the Visible property to conditionally control the widget's visibility. The default value for the property is true .
For example, if you want to make the widget visible only when the user selects "Yes" from a Select widget, you can use the following JavaScript expression:
{ { Select1 . selectedOptionValue === "Yes" } }

Animate Loading boolean ​

This property controls whether the widget is displayed with a loading animation. When enabled, the widget shows a skeletal animation during the loading process. Additionally, you can control it through JavaScript by clicking on the JS next to the property. The default value for the property is true .

Events ​

When the event is triggered, these event handlers can execute queries, JS functions, or other supported actions .

onPlay ​

Specifies the action to be executed when the audio starts playing.

onPause ​

Specifies the action to be performed when the audio is paused.

onEnd ​

Specifies the action to be taken when the audio playback is completed.

Reference properties ​

Reference properties are properties that are not available in the property pane but can be accessed using the dot operator in other widgets or JavaScript functions. They provide additional information or allow interaction with the widget programmatically. For instance, to get the visibility status, you can use Audio1.isVisible .

autoPlay boolean ​

Indicates the current state of the widget's Auto Play setting.
Example:
{ { Audio1 . autoPlay } }

playState string ​

Indicates the current state of the Audio widget's sound playback. It is represented by a string with values:

* PLAYING: Indicates that the audio is currently playing.

* NOT_STARTED: Represents the state when the audio has not started playing yet.

* PAUSED: Indicates that the audio is paused.

* ENDED: Represents the state when the audio playback has ended.

Example:
{ { Audio1 . playState } }

playing boolean ​

Indicates the current playing state of the widget. When the value is true , it means the audio is playing.
Example:
{ { Audio1 . playing } }

Methods ​

Widget property setters enable you to modify the values of widget properties at runtime, eliminating the need to manually update properties in the editor.

These methods are asynchronous and return a Promise . You can use the .then() block to ensure execution and sequencing of subsequent lines of code in Appsmith.

setPlaying (param: boolean): Promise ​

Updates the playing state of the Audio widget. When the setPlaying method is called with true , the audio starts playing, and when called with false , the audio stops playing.
Example :
Audio1 . setPlaying ( true )

setURL (param: string): Promise ​

Updates the URL of the audio to be played in the audio widget. Provide the desired URL as a string parameter to the setURL method.
Example :
Audio1 . setURL ( '<https://example.com/audio.mp3>' )

setVisibility (param: boolean): Promise ​

Updates the visibility of the Audio widget.
Example :
Audio1 . setVisibility ( true )

Was this page helpful?

Edit this page

Previous
Widgets
Next
Audio Recorder

* Content properties
* Data

* General

* Events

* Reference properties

* Methods

Links found on this page

  1. Skip to main content [direct]
  2. Try Appsmith [direct]
  3. Get Started [direct]
  4. Build Your First App [direct]
  5. Self Hosting [direct]
  6. New Installation Guides [direct]
  7. Manage Installation [direct]
  8. Upgrade Installation Guides [direct]
  9. Concepts [direct]
  10. Connect Data [direct]
  11. How-to Guides [direct]
  12. Reference [direct]
  13. Query Settings [direct]
  14. Concepts [direct]
  15. Build Apps [direct]
  16. Quickstart [direct]
  17. How-to Guides [direct]
  18. Reference [direct]
  19. Widgets [direct]
  20. Audio Recorder [direct]
  21. Button [direct]
  22. Button Group [direct]
  23. Camera [direct]
  24. Card [direct]
  25. Category Slider [direct]
  26. Chart [direct]
  27. Checkbox [direct]
  28. Checkbox Group [direct]
  29. Code Scanner [direct]
  30. Container [direct]
  31. Currency Input [direct]
  32. Custom [direct]
  33. Datepicker [direct]
  34. Divider [direct]
  35. Document Viewer [direct]
  36. Form [direct]
  37. Filepicker [direct]
  38. Icon Button [direct]
  39. Iframe [direct]
  40. Image [direct]
  41. Input [direct]
  42. JSON Form [direct]
  43. List [direct]
  44. Map [direct]
  45. Map Chart [direct]
  46. Menu Button [direct]
  47. Modal [direct]
  48. MultiSelect [direct]
  49. Multi TreeSelect [direct]
  50. Number Slider [direct]
  51. Phone Input [direct]
  52. Progress [direct]
  53. Radio Group [direct]
  54. Range Slider [direct]
  55. Rating [direct]
  56. Rich Text Editor [direct]
  57. Select [direct]
  58. Stats Box [direct]
  59. Switch [direct]
  60. Switch Group [direct]
  61. Tabs [direct]
  62. Table [direct]
  63. Text [direct]
  64. TreeSelect [direct]
  65. Video [direct]
  66. Accessibility [direct]
  67. Theme [direct]
  68. Sample Apps [direct]
  69. Write Code [direct]
  70. How-to Guides [direct]
  71. Reference [direct]
  72. Global Objects [direct]
  73. Global Functions [direct]
  74. JS Libraries [direct]
  75. Fetch API [direct]
  76. Data Transformation [direct]
  77. JavaScript Settings [direct]
  78. Concepts [direct]
  79. Best Practices [direct]
  80. Manage Apps and Users [direct]