Prevent simultaneous audio playing
@Tom Ireland yes , autoplay is false . I set it up as a repeated li audio item with the src from my Airtable . I didn 't set anything else (or know how to ) . It shows up fine and it is not auto -playing by default . But if I hit play on one and then another one , the first one should pause automatically for better user experience . Hope that makes sense . Thanks again ! 🙂 I see . Thanks for sharing . You 'd need some way to identify what 's currently playing and then pause it I think . I 'm not sure there are any specific events for audio but it may be possible to do it another way . I 've not done much with audio in toddle , so couldn 't give any pointers . @Max - You done much with audio and come across this problem ? 🤞 someone else in the community might have some advice . If I get chance later and you don 't have a solution , I 'll see if I can have a play on a test branch myself (pun not intended ) . 😄 @Tom Ireland Thank you so much for trying to help . I should mention that my background is web design , and I am trying to build a searchable , sortable , and filterable audio playlist for my client with a database from Airtable . So all these are very new to me , but I am here to learn by building a real project . 🙂 @Max if you have a solution , I 'd appreciate your help ! 🙂 I had a wee look and I think you 'd need access to the events as per https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio#events and they 're not available in the events list just now . You could likely create a custom action if you 're comfortable doing so . @Tom Ireland thank you for your help ! I embedded a script element within the repeated audio element and added javascript below from chat GPT and it totally works , lol . Though I am thankful that I got the outcome I wanted , I am sure this is not the right way to approach it in Toddle environment . Am I correct to say that ? let currentAudio = null ; document .querySelectorAll ( 'audio ' ) .forEach (audio = > { audio .addEventListener ( 'play ' , function ( ) { if (currentAudio & & currentAudio ! = = this ) { currentAudio .pause ( ) ; currentAudio .currentTime = 0 ; } currentAudio = this ; } ) ; } ) ; That 's one way to do it , @m . If I 'm reading it correctly , all that JS is doing is getting all of the audio elements , checking if currentAudio is not the one playing , pausing what is playing and then playing the one selected . I think . 😄 In toddle , you 'd do something similar e .g . have a variable set to null , then set the value of the variable to be the one that is playing when play is selected , then pause existing audio if a new one is selected and update the variable . But , you need a play event (as per the JS addEventListener ) in order to handle that better in toddle . You could do the same thing with custom actions and regain a bit more control over it but what you 've done will achieve the same thing - a few ways to skin a cat . Might be worth posting a suggestion for audio -specific events in the undefined channel and link to this discussion for context . Would be good to see more events added for other elements , particularly media . 🙂

.jpeg/public)