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.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

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

Recent Articles