Forums

  • # May 17, 2013 at 9:47 am

    Hi there

    I’m working on a simple audio player with HTML5 and jQuery:
    http://codepen.io/anon/pen/wksyj

    So far this works quite fine. But I have a list of several audio cues, each with its own control button. When I start playing a new cue I’d like an other cue already playing to stop.

    Just now when I click the play button while another cue is still playing, both audio files playing together, which definitely isn’t that nice.

    Any ideas for this problem?

    # May 17, 2013 at 9:52 am

    Something like this?:

    When you click play add a class like “playing” to that audio cue, then if you click play again somewhere search for all the cues that have the class “playing” and pauze or stop it. Then remove the class “playing” from that cue and add it to the new cue.

    # May 17, 2013 at 12:42 pm

    @mottie: Thanks a lot for your code. It works like MAGIC! :-)

    @FragaGeddon, @Argeaux: Thanks for your inputs, too.

    # September 19, 2013 at 11:57 pm

    This has been something that I’ve been looking for, however I’m still only new. Is there a way of pausing the current track without going to the next track?

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag