Results 1 to 2 of 2

Thread: Stop the audio-player with a button

  1. #1
    Join Date
    Jul 2014

    Question Stop the audio-player with a button

    I'm making it short: I have a audio player (audio.js) which plays a song. But I want to make the audio pause when I click on a button above.

    This is my code:

    ("Hier die Musik ausschalten" is german and means "Stop playing".)

    HTML Code:
    <h1>Mein Audio-Test</h1>
    <button class="noMusic">Hier die Musik ausschalten!</button>
        <!-----Der Audio-Player--->
    <audio src="audio/Palace%20Cat%20-%20Crookshanks.mp3" preload="auto" />
        <!--------- Scripts für Audio --------------->
        <script src="audio/audiojs/audio.js"></script>
      audiojs.events.ready(function() {
        var as = audiojs.createAll();
        <!----------- jquery ----------->
        <script type="text/javascript" src="jquery/jquery-1.11.1.js"></script>
        <!-------- ----------- ------>
        $( ".noMusic" ).click(function( event ) {
             var player = this.settings.createPlayer;
            container[audiojs].helpers.removeClass(this.wrapper, player.playingClass);

    I really dont know what I'm doing wrong . Does anyone have an idea? Thank you very much!

  2. #2
    Join Date
    Mar 2007
    Please ask in the JavaScript (JQuery) frameworks forum.
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center