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

**URL:** <https://forum.bubble.io/t/automatically-stop-currently-playing-audio-when-new-one-is-played-in-bubble-app/262042>\
**Category:** Need help\
**Created:** [May 10, 2023, 11:22am UTC](https://forum.bubble.io/t/automatically-stop-currently-playing-audio-when-new-one-is-played-in-bubble-app/262042 "2023-05-10T11:22:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![royerfelix](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@royerfelix](https://forum.bubble.io/u/royerfelix)\
**Post date:** [May 10, 2023, 11:22am UTC](https://forum.bubble.io/t/automatically-stop-currently-playing-audio-when-new-one-is-played-in-bubble-app/262042/1 "2023-05-10T11:22:50Z")

</div>

Hello,

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.

---

<div class="post-metadata">

**Author:** ![royerfelix](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@royerfelix](https://forum.bubble.io/u/royerfelix)\
**Post date:** [May 15, 2023, 3:55pm UTC](https://forum.bubble.io/t/automatically-stop-currently-playing-audio-when-new-one-is-played-in-bubble-app/262042/2 "2023-05-15T15:55:17Z")

</div>

Anyone ?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [July 19, 2023, 11:23am UTC](https://forum.bubble.io/t/automatically-stop-currently-playing-audio-when-new-one-is-played-in-bubble-app/262042/3 "2023-07-19T11:23:15Z")

</div>

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