/bubble-tutorials

How to build a music player in Bubble

Learn how to build a custom music player in Bubble with clear steps, tips, and features to help you launch a smooth audio experience fast.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web or mobile app? RapidDev builds Bubble apps with your growth in mind.

Book a Free Consultation

How to build a music player in Bubble

The simplest way to build a music player in Bubble is to store each audio file in the database as a file field, place an HTML element or Bubble’s built‑in Audio Player element on the page, and dynamically bind its source to the audio file’s URL. Then you control playback with normal Bubble workflows (play/pause/next) by changing the “Current Track” custom state.

 

Core Structure

 

You need three parts: a Track data type, a Repeating Group listing tracks, and a Current Track custom state. The music player displays the currently selected track and updates whenever the user chooses a new one.

  • Data type Track: fields like Title (text), Artist (text), Audio File (file), Cover (image)
  • Repeating Group: shows all Tracks
  • Custom state: on the page, e.g. “current\_track” (type = Track)

 

Displaying and Playing Audio

 

Bubble’s Audio element works if you bind the source to “Parent group’s Track’s Audio File”. If you want full control (autoplay when changing track, custom buttons), use an HTML element with a native audio tag whose source updates dynamically.

<audio id="player" controls src="dynamic_value_here"></audio>

 

Workflows

 

  • When user clicks a track in the Repeating Group → set page custom state “current\_track” to “Current cell’s Track”.
  • To auto-play on track change, use a workflow “When current\_track is changed” → run JavaScript to trigger play.
document.getElementById("player").play(); // Plays current audio

 

Next / Previous Buttons

 

  • Use the list from the Repeating Group’s search.
  • Find current_track’s index, then set current_track to item at index+1 or index-1.

 

Permissions

 

Set Privacy Rules so only allowed users can access audio files, or store them in private S3 URLs if required.

Explore More Valuable No-Code Resources

How to integrate Bubble.io with Git?

Learn how to seamlessly integrate Bubble.io with Git through our comprehensive step-by-step guide. Perfect for beginners and professionals.

Explore

How to integrate Bubble.io with Reddit Ads?

Learn how to seamlessly integrate Bubble.io with Reddit Ads using our easy step-by-step guide. Boost your ad management today!

Explore

How to integrate Bubble.io with AWS S3?

Explore our step-by-step guide on integrating Bubble.io with AWS S3, making your app development process more efficient and secure.

Explore

How to integrate Bubble.io with Lucidchart?

Follow our step-by-step guide to seamlessly integrate Bubble.io with Lucidchart, enhancing your workflow & productivity.

Explore

How to integrate Bubble.io with Kentico?

Learn how to seamlessly integrate Bubble.io and Kentico with our comprehensive, easy to follow step-by-step guide.

Explore

How to integrate Bubble.io with Box?

Discover easy-to-follow steps for integrating Bubble.io with Box. Boost your workflow and secure your files seamlessly today.

Explore

Stuck in Bubble.io? We’re here to help!

Fix broken workflows | Optimize logic | Boost performance | Scale with confidence

4.9
Clutch rating 🌟
600+
Happy partners
17+
Countries served
190+
Team members

By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.

Cookie preferences