Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Javasript to control MP3 player


Recommended Posts

I use osCommerce 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>


Link to comment
Share on other sites

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.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...