Play audio
Plays an MP3 track in your app.

๐Ÿ‘‰ The Tag

This set of tags allows to play an MP3 track in your app.
Play audio
Pause audio
Play audio in background
Loading indicator
Current played time
Total time
1
[action:play:URL] or [action:play]
2
โ€‹
3
Use [action:play] if you are getting the URL by API.
Copied!
Plays the MP3 audio track. When this element is visible, the pause element will be invisible, and vice versa.
Replace URL with an actual URL ending in .mp3
๐Ÿ“ Where to add the tag: Any layer, except top-level and container.
1
[action:pause]
Copied!
Pauses the MP3 audio track. This element will be invisible until user clicks the play element.
๐Ÿ“ Where to add the tag: Any layer, except top-level and container.
1
[audio:background]
Copied!
Optional tag. If this tag is included, audio files will continue playing when the app is open in the background. In order to stop the audio, users will have to return to the page where the audio was started and tap pause.
If this tag is not included, audio files will only play when its page is visible and will pause otherwise.
๐Ÿ“ Where to add the tag: Any layer, except top-level and container.
1
[audio:loading]
Copied!
Optional tag. The element that will be displayed from the moment the play element is clicked until the audio file is ready to be played, along with the pause element.
๐Ÿ“ Where to add the tag: Any layer, except top-level and container.
1
[audio:currenttime]
Copied!
Displays the progressive playing time & the total time of the audio track.
๐Ÿ“ Where to add the tag: A text layer.
1
[audio:totaltime]
Copied!
Displays the total time of the audio track.
๐Ÿ“ Where to add the tag: A text layer.
Make sure your phone it's not on mute.

๐Ÿท๏ธ How to add the tag

1. Paste the tag [action:play:URL] into the layer name of your play element (can be an icon, shape, button, or text).
2. Paste the tag [action:pause] into the layer name of your pause element (can be an icon, shape, button, or text).
Place the pause element underneath the play element in your design file to make it look synchronized.
3. Paste the tag [audio:currenttime] into the layer name of a text layer. The placeholder time in your design will be replaced by a progressive counter in 00:00 format.
4. Paste the tag [audio:totaltime] into the layer name of a text layer. The placeholder time in your design will be replaced by the real total time of the audio in 00:00 format.
5. [OPTIONAL] Add the tag [audio:background] to the same layer where you added [action:play:URL].
6. [OPTIONAL] Paste the tag [audio:loading] into the layer name of your loading element.
Pro tip: use the Lottie component to easily add a Lottie animation in your intro.
7. Import to Bravo & preview on Bravo Vision ๐Ÿš€

๐Ÿ’พ Example files

Duplicate the files below to see how to set it up!
Bravo Sample - Audio.xd.zip
6MB
Binary
Audio.xd
Last modified 1mo ago