Automatically stop currently playing audio when new one is played in Bubble app


I am currently working on a music streaming application. When the user logs in, they have access to a list of music that they can listen to. I would like it so that when a user clicks “play” on a song and there is already a song playing, the current song automatically stops. I am using the Custom Audio Player plugin to play the music on my application.

Here is how my custom audio player is set up: I have a RepeatingGroup called “RepeatingGroup Music” with a type of content of “Music”. Inside the repeating group, I created a group called “Player”. I added a “Play” icon inside the group that, when clicked, triggers a workflow and plays the audio. Next to the play button, there is a “Text Player” group with two text fields displaying the “Parent Group’s music’s Title” and “Parent Group’s music’s Artist Name”. Next to this group, there is a “GroupAudio Play” group with a “Custom Audio Player” plugin inside. The audio comes from the “music” data type - “song content”.

I then added a custom state on my page called “Current Audio ID”, which is a text field. And I created a workflow that adds the “parent group’s music’s unique id” to the custom state.

Do you know how I can make it so that songs that are not in the “Current Audio ID” custom state automatically stop?

Thank you for your help.

Anyone ?

This topic was automatically closed after 70 days. New replies are no longer allowed.