Participating Frequently
August 28, 2020
Question
Stop embedded audio with javascript
- August 28, 2020
- 1 reply
- 2257 views
I have created an audio player using HTML5 and javascript. This is embedded as an HTML5 animation. There is a play/pause button and a stop button. This player is located on a smartshape that is hidden. When a user clicks a link, the smartshape appears and they are free to play/pause or stop the audio.
My dilemma is when they close the smartshape, is there a way to to stop the audio? The second question is if I have more than one audio embedded, is there a way to stop one player when the second starts?
I've attached a screenshot of the smartshape with the player. The HTML5animation is actually a zip folder containing an HTML page, CSS, the javascript code, images of the bottons and an mp3.
