+ 6

How do I prevent more than one audio playing?

Need help!!! Edit: Sorry for that. Here's the code: https://code.sololearn.com/Wnj3iJnhBCEv/#html Edit2: My Goal: When the user plays a song while there is another song playing, it starts the song that the user selected / wants to play but pauses all of the other ones.

15th Dec 2017, 9:40 AM
luʁi
5 ответов
+ 3
Try using the JS pause() method. To see if either audio is playing, you can either use an if or while statement, or you can use an event listener. Here's an example ( https://code.sololearn.com/Wjq3JTNqsS8U/?ref=app ). Hope that this helps.
16th Dec 2017, 2:48 PM
Jacob Duelz
Jacob Duelz - avatar
+ 5
The code is now available. Sorry...
15th Dec 2017, 9:43 AM
luʁi
+ 4
put autoplay="false"; inside the <source> tag
15th Dec 2017, 10:52 AM
Joe Catoe
Joe Catoe - avatar
+ 3
Thank you for your answer @Joe Catoe but it doesn't work the way I want it to work
15th Dec 2017, 1:03 PM
luʁi
- 1
The program enters the user during the morning and evening and the night and the program printing period in the hours of morning can you help me The fastest speed
15th Dec 2017, 2:53 PM
Bakre Mohmed Ali
Bakre Mohmed Ali - avatar