Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Javasript to control MP3 player


Kurre

Recommended Posts

Posted

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>

 

Posted
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

Posted

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.

Posted

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.

Posted
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 !

Archived

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

×
×
  • Create New...