Audio content is one of the most popular forms of media and entertainment on the internet today. The new Audio Player component lets you easily include audio in your app with just a few clicks.
Whether you’re looking to build an audio-first platform like Spotify or simply include your own audio content in your app, the Audio Player component makes it easy.
The component, available free in Backendless Marketplace, lets your app play MP3 audio files with standard controls such as play, pause, fast-forward, rewind, and volume control.
Skip forward and backward buttons will display if the playlist consists of more than one audio file. Finally, you are also able to easily activate auto play and repeat features as well.
Installing custom components from Backendless Marketplace is super easy. First, in UI Builder, select the Components tab.
There, you will see a button labeled Install Component. This will take you to the library of components available in the Marketplace.
When you click Install Component, you will open a list of available UI Components to install.
Select the component you want and click Install.
When you return to the User Interface tab, you will see a new section added to your toolkit on the right-hand side called Custom Components.
You can then simply drag the component onto your canvas just like any other UI Component.
How the Audio Player Component Works
When added to your app, the Audio Player component offers several basic functions out of the box.
First, the player can display the title of the audio file/track. You can set a default title, or display a title through data binding. If the title field is empty, even if visibility is set to true, the title block will not be displayed.
Next, the player has the standard playback options: play/pause, fast forward and rewind.
Third, the player includes an audio track progress bar, volume slider, and displays the track progress numerically.
You may optionally set the player to auto play and repeat the current track (or playlist).
With a few modifications to the styles using Extensions, you can customize the appearance of the player to fit your design. Below is a very simple example:
We can then add Codeless logic to the Audio Url Logic and Audio Title Logic to create a playlist.
With multiple tracks included in the playlist, the skip forward and skip backward buttons are now displayed, allowing the user to skip between tracks in the playlist.
Available Options and What They Mean
Once you have placed your component, when you select it, you will see all of the available options (properties) for the component in the toolkit area. These are the default settings for the component that you can easily adjust.
Each of the available properties are described in the table below. For more information, such as Theme styles and event handlers, visit the Audio Player GitHub repo.
Property
Type
Default value
Logic
Data Binding
UI Setting
Description
Audio Url
Text
Audio Url Logic
YES
YES
Specifies the url of the audio or the list of audio urls
Audio Title
Text
Audio Title Logic
YES
YES
specifies the title of the audio or the list of audio titles
Player Visibility
Checkbox
true
NO
YES
enables the visibility of the audio player
Track Navigation Visibility
Checkbox
true
NO
YES
enables the visibility of the track navigation
Title Visibility
Checkbox
true
NO
YES
enables the visibility of the track title
Default Volume
Range
50
NO
YES
controls the default volume of the player
Auto Play
Checkbox
false
NO
YES
enables automatic playback of the track after the page is loaded
Repeat
Checkbox
false
NO
YES
enables repeating one track over and over again
When you click on the Logic icon or tab for the component, you will see the modifiable event handlers, just as you would with a standard component. However, the main logic for the component – the logic that makes it work – is hidden to protect it from accidentally being broken.
Additionally, in the Logic area, you will also find all available data binding properties.
That’s it! Ready to try it for yourself?
The Audio Player component is one of many custom components available now in Backendless Marketplace, completely free!
Start Building Your Perfect UI
Start your free 30-day trial today to get access to the full library of UI components, plus the most powerful Codeless backend available. What are you waiting for?
A snackbar or “toast” element is a message displayed to the user, usually on a temporary basis over a few seconds. It’s great for alerting the user to something without requiring any action. Think of a success message, a confirmation, or an error alert of some kind.