---
sourceDocument: Brazil Build or modify applications
sourceDocumentLink: https://www.servicenow.com/docs/r/application-development

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Build or modify applications

ft:clusterId :

    - cadev

bundleId :

    - cadev

workflow :

    - Development, Data, and Analytics


---

# Audio Player component setup

# Audio Player component setup {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 4 minutes to read  
The Audio Player component to embed sound content into a web page document.

## Before you begin

This task assumes you have placed the component on the page and are ready to configure the properties and events. For instructions on accessing and using features in UI Builder, see [Customize UI Builder pages using components](https://www.servicenow.com/docs/YMtTz79hYjmj5_kMcObIuA "Learn what a component is in UI Builder. Also, see how components work within UI Builder.").  
Note:  
This document describes the latest component functionality. Go to the store to make sure you have the latest version of the component.

Role required: admin or ui_builder_admin

## Procedure

1. Define a label for your Audio Player that differentiates it from other components in the content tree.  
   A label makes finding the component easier in a large list of components. For instructions on using the content tree, see [Manage UI pages and page variants](https://www.servicenow.com/docs/Hq7OFdFRjvDFnNsfdtsMGw "Learn what a page is in UI Builder. Understand the building blocks of a UI Builder page, such as column layouts and components.") .

   ![Audio Player in content tree.]()
2. Select the Audio Player component, using one of these methods:
   * Click anywhere within the component.
   * Select the Audio Player label you created for your component in the content tree.

   {#audio-player-component-uib-setup__choices_zpq_1gf_yrb}  
   The property fields appear in the Config tab in the setup panel on the right.
{#audio-player-component-uib-setup__steps_ypq_1gf_yrb}

## Audio Player component properties {#ariaid-title2}

Configure the audio file location and player behavior such as looping with these
properties.
To configure the properties, enter either static or dynamic input. Enter dynamic input by selecting the input type.

* Data binding: Creates dynamic property values from multiple sources. Sources include state variables (@state), URL variables (@context), or data resource payloads (@data). For details, see [Add and configure data resources to a
  page](https://www.servicenow.com/docs/~B53KgSqh6jyRj9wmzg8LA "Add data resources to dynamically expose data from tables, records, or other elements on your page in UI Builder.") .
* Scripting: Creates a scripted property value. For details on scripted values, see [Create and bind a client state parameter to a component](https://www.servicenow.com/docs/JxkxcsWDJlkywLr4rc~p8A "Create and bind a client state parameter value to a component in UI Builder. By adding custom values to your components, these components can then be automatically updated through a script.") .
{#audio-player-config-properties__choices_4jq_bp0_csl} {#audio-player-config-properties__table_hqk_1hf_yrb__entry__3}

| Field | Property | Description |
|-|-|-|
| Audio file URLs | sources | A JSON array of URLs for audio content. The browser chooses the first source that it supports. The URLs can be a full URL, a file on the instance, or embedded data. Examples: * Full URL: `["https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3"]` * From instance: `[\"connect_alert.mp3\"]` * Embedded data: `["data:audio/mp3;base64,//....<data hash>...]` {#audio-player-config-properties__ul_nnt_xcb_zrb} |
| Muted | muted | When true, audio is silent. To give the user the choice of muting the audio, set the value in a client state parameter. See "Set up UI controls for mute, autoplay, and loop." Default: false |
| Autoplay | autoplay | When true, plays the audio content automatically when it loads. To give the user the choice of autoplaying the audio, set the value in a client state parameter. See "Set up UI controls for mute, autoplay, and loop." Note: The audio player does not begin to autoplay until a user interacts with it. Default: false |
| Loop | loop | When true, the audio content automatically repeats when it reaches the end. To give the user the choice of looping the audio, set the value in a client state parameter. See "Set up UI controls for mute, autoplay, and loop." Default: false |
[ ]

{#audio-player-config-properties__table_hqk_1hf_yrb}

## Set up UI controls for mute, autoplay, and loop {#ariaid-title3}

Enable the user to mute, autoplay, or loop audio on the Audio Player component.

### Before you begin

You configure a Checklist component as part of this procedure. Consider opening the reference for that component in another browser tab.

Role required: ui_builder_admin

### Procedure

1. In the UI Builder, open the page that contains the Audio Player component.
2. On that page, set the Muted, Autoplay, and Loop client state parameters.  
3. Bind the client state parameters to the Mute, Autoplay, and Loop properties of the Audio Player component.  

   For more information, see [Create and bind a client state parameter to a component](https://www.servicenow.com/docs/JxkxcsWDJlkywLr4rc~p8A "Create and bind a client state parameter value to a component in UI Builder. By adding custom values to your components, these components can then be automatically updated through a script.").
4. Add a Checklist component to the page.
5. In the check box items property of the Checklist, add an item for each of the Audio Player properties.  
   The following JSON defines a check box for the Mute and Loop properties, but not Autoplay.

       [{"order":0,"checked":false,"itemId":"Muted","label":"Muted","link":{"text":"","url":""}},
       {"order":2,"checked":false,"itemId":"Loop","label":"Loop","link":{"text":"","url":""}}]

6. Write a client script to serve as the event handler.  

       /**
       * @param {params} params
       * @param {api} params.api
       * @param {any} params.event
       * @param {any} params.imports
       * @param {ApiHelpers} params.helpers
       */
       function handler({api, event, helpers, imports}) {
           const {checked, itemId} = event.payload;
           api.setState(itemId, checked);  
       }

   For more information, see [Define and bind client
   scripts to components](https://www.servicenow.com/docs/zFMkcpOBQwAyv_HgOcChZQ "Add and edit client scripts in UI Builder so that you can update the client state through events. You can bind these scripts to any component by using an event handler.").
7. Select the client script as the NOW_CHECKLIST#ITEM_CLICKED event handler.  

### Audio Player in runtime {#set-up-ui-mute-autoplay-loop__example_zd2_dmb_zrb}

The following Next Experience runtime page shows an Audio Player component. The component opens a file at a full URL. There is a Checklist component under the Audio Player. A user can use the Checklist component to mute or loop the audio.

Note:  
The Audio Player does not begin to autoplay until a user interacts with it.

## Audio Player component events {#ariaid-title4}

Select event handlers to configure the actions (events) provided with the Audio Player component.
The Events tab shows the events used by the Loader component. To view the available events, select + Add event mapping. Select the event in the list to add one or more event handlers.

### Event handlers {#audio-player-config-events__section_kp4_53f_yrb}

Event handlers work with data resources to link the Audio Player actions to the data you want to display to your users. Select the event in the list to add one or more event handlers.

For instructions on adding event handlers to an event, see [Configure an event handler](https://www.servicenow.com/docs/8s23OEG1s5oowl~vaOUlLw "Add an event handler to a page, component, data resource, or declarative action within UI Builder so that your user can trigger an action.").

The Audio Player events are only meant to notify that an event has happened. They do not have payloads.

### Event descriptions {#audio-player-config-events__section_fzs_1vp_twb}

{#audio-player-config-events__table_mp4_53f_yrb__entry__2}

| Event | Description |
|-|-|
| Audio has started | Dispatched when playback or streaming has started because of autoplay. Toggles off the pause. |
| Audio has paused | Dispatched when playback or streaming has paused. |
| Audio has ended | Dispatched when playback or streaming has ended. |
[ ]

{#audio-player-config-events__table_mp4_53f_yrb}

