Kurre Posted May 7, 2019 Posted May 7, 2019 I use osCommerce 2.3.4.1 CE BS version I embedded HTML5 player code for demo music in the products description, in productlistning the player shows as it should. But when I cklick a demo music player it plays, and when I cklick another demo music to listen the first one don't stop but plays along with the second one and the third one and so on if you dont't click stop on the first song. Is there a javascrip I can use to stop the first song from playing if I click another song ? The embeded code I use is <AUDIO controls><SOURCE type="audio/mpeg" src="https://www.somesite.se/songs/demo.mp3"></AUDIO>
ArtcoInc Posted May 7, 2019 Posted May 7, 2019 @burt Didn't you have a MP3 module in one of your 28 day bundles?
burt Posted May 7, 2019 Posted May 7, 2019 1 minute ago, ArtcoInc said: @burt Didn't you have a MP3 module in one of your 28 day bundles? It does ring a bell... boom/tish. It was in the very first 28d from 2015. So long ago, well remembered @ArtcoInc
Kurre Posted May 7, 2019 Author Posted May 7, 2019 I need to use embed code in product description to every song, the shop has 5 000 songs to sell so it's not possible to use one mp3 player with a playlist.
MrPhil Posted May 7, 2019 Posted May 7, 2019 It sounds like you need something to send a signal to any playing content to STOP, when you START a new one. I would imagine that the interface to do such a thing exists (if nothing else, to STOP the player when you click on STOP button). You might have to keep track of what's playing in your Javascript, and then hopefully it's no more than adding a STOP command whenever a START is clicked. Don't forget to also handle any PAUSE in a similar manner, to prevent two or more songs from playing together.
♥JcMagpie Posted May 7, 2019 Posted May 7, 2019 4 hours ago, Kurre said: Is there a javascrip I can use to stop the first song from playing if I click another song ? Try this, https://stackoverflow.com/questions/19790506/multiple-audio-html-auto-stop-other-when-current-is-playing-with-javascript
♥JcMagpie Posted May 7, 2019 Posted May 7, 2019 Here is a sample html page with 2 players play one , then play the second and first is paused as second plays. It's basic but gives you the idea of how it can be done. 2 Players-test.html
Kurre Posted May 7, 2019 Author Posted May 7, 2019 6 minutes ago, JcMagpie said: Here is a sample html page with 2 players play one , then play the second and first is paused as second plays. It's basic but gives you the idea of how it can be done. 2 Players-test.html Yes! That was just what I needed, many thanks to you for your help JcMagpie !
Recommended Posts
Archived
This topic is now archived and is closed to further replies.