Set up the Template for New Audio Choice

The audio picker allows the end user to choose between the default audio file or upload/pick a new one from its library.

To configure the template, you will need to edit the .html file (see Update the HTML File) and .json file (see Update the params.json File).

Note: The end user is only able to choose or pick a new audio file if the following parameter is present and set to true for the given image field "allowNewAudio": true.

HTML File

The HTML file must have a div class that will contain the audio file offered to the end user:

Copy
<div class="imageContainer">
    <img data-publish-id="Music" class="audio" src="./img/music1.mp3" alt="main audio file" />
</div>

JSON File

The params.json file must have a corresponding section that allows the end user to choose between the default audio file or upload/pick a new one from its library:

Copy
{    
    "id": "Music",
    "label": "Choose your audio",
    "default": "./audio/music1.mp3",
    "type": "audio",
    "allowNewAudio": true
}