Skip to main content
RapidDev - Software Development Agency
bubble-tutorial

How to implement an audio player in Bubble.io: Step-by-Step Guide

You can implement a custom audio player in Bubble using the HTML Audio element or a plugin like Audio Player by Zerocode. This tutorial covers adding play/pause/seek controls, building a progress bar, displaying track metadata, creating a playlist queue, and handling background playback — all through Bubble's visual editor with minimal custom code.

What you'll learn

  • How to add audio playback to a Bubble app using plugins or HTML elements
  • How to build custom play/pause, seek, and volume controls
  • How to display a progress bar and track metadata
  • How to create a playlist queue with next/previous navigation
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner7 min read20-25 minAll Bubble plansMarch 2026RapidDev Engineering Team
TL;DR

You can implement a custom audio player in Bubble using the HTML Audio element or a plugin like Audio Player by Zerocode. This tutorial covers adding play/pause/seek controls, building a progress bar, displaying track metadata, creating a playlist queue, and handling background playback — all through Bubble's visual editor with minimal custom code.

Overview: Implementing an Audio Player in Bubble

This tutorial shows how to build a functional audio player in your Bubble app. Whether you are building a podcast app, music platform, or e-learning tool with audio lessons, you will learn to play audio files, build custom controls, display track information, and manage playlists. We use a combination of Bubble plugins and HTML elements to create a polished audio experience.

Prerequisites

  • A Bubble account with an app
  • Audio files uploaded to Bubble's file manager or hosted externally
  • Basic familiarity with Bubble plugins and Custom States
  • Optional: an audio player plugin from the Bubble marketplace

Step-by-step guide

1

Install an audio player plugin or set up HTML audio

Go to the Plugins tab and search for audio player. Install a plugin like Audio Player by Zeroqode or BDK Native Audio. If you prefer a code-free approach, you can use Bubble's HTML element with a standard HTML5 audio tag. For the plugin approach, install it and add the Audio Player element to your page from the Element Palette. For the HTML approach, add an HTML element and enter: <audio id='myPlayer' src='dynamic_url'></audio>. The plugin approach is recommended as it provides more control without writing code.

Expected result: An audio player element or HTML audio element is on your page ready for configuration.

2

Create the Track data type and configure the data source

Go to the Data tab and create a Track data type with fields: title (text), artist (text), album (text), duration (number in seconds), audio_file (file), cover_image (image), track_number (number), playlist (Playlist type if applicable). Upload your audio files via the File Manager or through the app's upload interface. On your player page, set the audio player's source to the current track's audio_file URL. Add a Custom State called current_track (type Track) on the page to track which song is playing.

Expected result: A Track data type stores audio metadata, and the player is connected to a track's audio file.

3

Build custom playback controls

Add visual elements for your player controls: a Play/Pause toggle button (use an Icon element that switches between play and pause icons based on a Custom State is_playing), Previous and Next buttons, and a volume slider (use a SliderInput element). Create workflows: When Play button is clicked → set is_playing state to yes and trigger the plugin's Play action. When Pause is clicked → set is_playing to no and trigger Pause. For volume, when the SliderInput value changes → set the player's volume. Style the controls in a horizontal row resembling a standard media player.

Pro tip: Use Conditional formatting on the play/pause button: When is_playing is yes → show the pause icon. When is_playing is no → show the play icon.

Expected result: Play, pause, skip, and volume controls work and update their visual state in real time.

4

Add a progress bar with seek functionality

Add a Group element as the progress bar container (full width, 4-8px height, grey background). Inside it, add another Group as the progress fill (same height, colored background). Set the fill width dynamically using the plugin's current time / track duration * 100 percent. If using the HTML approach, use JavaScript to update a Custom State with the current playback time every second. For seek functionality, add a click event on the container Group: calculate the click position as a percentage of the bar width and set the player's current time to that percentage of the duration.

Expected result: A progress bar shows the current playback position and users can click to seek to any point in the track.

5

Display track metadata and album art

Above or below the controls, add display elements: an Image element bound to current_track's cover_image, a Text element for current_track's title (large, bold), a Text for current_track's artist, and time displays showing current time / total duration in MM:SS format. For the time format, use a text expression that converts seconds to minutes:seconds (e.g., floor(seconds/60):formatted as 0 + ':' + seconds mod 60:formatted as 00). Update these displays dynamically as the track changes.

Expected result: The player displays album art, track title, artist name, and current/total time for the playing track.

6

Create a playlist queue with navigation

Add a Repeating Group below or beside the player showing a list of Tracks. Highlight the currently playing track using a Conditional: When Current cell's Track is page's current_track → background color change. When a user clicks a track in the list, set current_track to the clicked track and start playback. For Next and Previous buttons, find the current track's position in the playlist and navigate to the next or previous item. Create a workflow: Get current_track's track_number, search for Track where track_number = current + 1 and playlist = current playlist. For more advanced audio features like streaming and DRM, RapidDev can assist with custom integrations.

Expected result: A playlist shows all tracks, highlights the current one, and next/previous buttons navigate through the queue.

Complete working example

Workflow summary
1AUDIO PLAYER WORKFLOW SUMMARY
2==============================
3
4DATA TYPES:
5 Track: title, artist, album, duration (seconds),
6 audio_file, cover_image, track_number
7 Playlist: name, tracks (list of Tracks), creator (User)
8
9CUSTOM STATES (on page):
10 current_track (Track)
11 is_playing (yes/no)
12 current_time (number)
13 volume (number, default 80)
14
15PAGE ELEMENTS:
16 - Album art Image
17 - Title and artist Text elements
18 - Play/Pause button (icon toggles)
19 - Previous / Next buttons
20 - Progress bar (Group container + fill Group)
21 - Time display (current / total)
22 - Volume SliderInput
23 - Playlist Repeating Group
24
25WORKFLOW 1: Play/Pause Toggle
26 Event: Button Play/Pause clicked
27 If is_playing = no Play audio, set is_playing = yes
28 If is_playing = yes Pause audio, set is_playing = no
29
30WORKFLOW 2: Next Track
31 Event: Button Next clicked
32 1. Find Track where track_number = current + 1
33 2. Set current_track = result
34 3. Set audio source = new track's audio_file
35 4. Play audio
36
37WORKFLOW 3: Previous Track
38 Same as Next but track_number = current - 1
39
40WORKFLOW 4: Select from Playlist
41 Event: Track in Repeating Group clicked
42 1. Set current_track = clicked track
43 2. Play audio
44
45WORKFLOW 5: Seek
46 Event: Progress bar Group clicked
47 1. Calculate position = click X / bar width * duration
48 2. Set audio current time = position
49
50WORKFLOW 6: Volume Change
51 Event: SliderInput value changed
52 Action: Set audio volume = slider value / 100

Common mistakes when implementing an audio player in Bubble.io: Step-by-Step Guide

Why it's a problem: Not handling autoplay browser restrictions

How to avoid: Always require a user click (play button) to initiate audio. Never assume audio will autoplay.

Why it's a problem: Using large uncompressed audio files

How to avoid: Compress audio files to MP3 at 128-192kbps before uploading. This balances quality with file size.

Why it's a problem: Not resetting the progress bar when changing tracks

How to avoid: In the track change workflow, reset the current_time Custom State to 0 and update the progress bar before starting playback.

Best practices

  • Use MP3 format for broad browser compatibility
  • Compress audio to 128-192kbps for web delivery
  • Always require user interaction before playing audio (browser autoplay policy)
  • Reset progress bar and time display when changing tracks
  • Highlight the currently playing track in the playlist
  • Add keyboard shortcuts (space for play/pause) for better accessibility
  • Show a loading state while audio buffers

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I want to build a custom audio player in Bubble.io with play/pause, seek bar, volume control, playlist, and album art display. What plugin should I use, and how do I structure the data types, custom states, and workflows?

Bubble Prompt

Add an audio player to my app. I need a Track data type, a player with play/pause/next/previous controls, a progress bar, volume slider, album art display, and a playlist Repeating Group that highlights the current track.

Frequently asked questions

Which audio formats does Bubble support?

Bubble can store any file type. For playback, use MP3 for broadest browser compatibility. WAV and OGG also work in most modern browsers. Avoid FLAC for web playback.

Can I stream audio instead of downloading the full file?

HTML5 audio elements stream by default — they begin playback before the full file is downloaded. For very large files, ensure your audio is served with proper HTTP range headers.

Does the player keep playing when navigating to another page?

No. Navigating to a new page stops playback. To maintain playback across pages, place the player in a Reusable Element (Floating Group) that persists across page changes, or use a single-page app architecture.

Can I add playback speed control?

Yes. HTML5 audio supports playback rate changes. Use a JavaScript action or plugin setting to adjust the playbackRate property (0.5x, 1x, 1.5x, 2x).

How do I handle audio file storage limits?

Bubble's free plan includes 0.5GB storage. Audio files can be large — a 5-minute MP3 at 192kbps is about 7MB. For apps with many tracks, consider hosting audio on an external CDN like Cloudflare R2 or AWS S3.

Can RapidDev help build advanced audio features?

Yes. RapidDev can help implement features like waveform visualization, audio recording, real-time streaming, transcription, and integration with music distribution APIs.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.