/    Sign up×
Community /Pin to ProfileBookmark

Javascript music player

Hi all,

I am very new here (within 15 minutes) and hoping you guys could help me about with a bit of code for a site I am working on. I would be most grateful.

Quite simply, I don’t use any flash and have made a simple stylish list of tracks in a table. When the track title is clicked, or the ‘play’ image is clicked, the track will play.

When I start coding this tomorrow, I can probably get it to play the music using Javascript. BUT, I want it stop any playing tracks when another track is started. So the user doesn’t need to stop a playing track before playing a new one.

The code behind each track link/image therefore needs to detect if another item is playing, and if so, act as a ‘stop all other audio’ before beginning it’s own track… Not sure.

Thanks in advance!
Mike

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @messymike123 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...