Okay
  Public Ticket #2551695
stop audio
Closed

Comments

  • kris66 started the conversation

    Hi :)
    I am trying to stop (or pause) all audio automatic (ex. audio player) when opening an album page "open-disc" and as well when closing the "disc" page again "close-btn".
    But I haven't been able to get it to work in the discography.js .. Any suggestions?
    Yours Sincerely
    Kristian

  •  850
    Jelly replied

    Hello,

    Could you send us a link to your website?

    By default it's not supposed to autoplay anything, so we need to check this on your side.

    Best Regards,
    Jelly Team

  • kris66 replied

    Hi :)
    I do not have my website online yet. And it's not about autoplaying. It's about being able to stop or pause audio from playing when i as an example click the "close.btn" on the "disc" page. The close-btn is found in discography.js but i haven't been able to successfully add code to the javascript that stop audio from playing.

    Yours Sincerely
    Kristian

  •  850
    Jelly replied

    Hello,

    You need this code: https://tppr.me/EvF6P

    Assigned it to close-btn class and it should work.

    Unfortunately, we cannot help with customizations since it's against Envato's rules.

    Best Regards,
    Jelly Team

  • kris66 replied

    Thanks for the code

    if( $(this).attr('class') == 'playing' ) {
        $(this).addClass('pause');
        audio1.playPause();

    but I've already tried that and I can't seem to make it work.


    Where in the code do I have to place it?

    function close(){

      $(".close-btn").on( "click", function() {
        $(".project-window").slideUp("slow");
        $(".project-content").fadeOut("slow");
        $("html, body").animate({ scrollTop: $('#discography').offset().top -(50) }, 1000);
        opened=false;
      });
    }

    Yours Sincerely
    Kristian

  •  850
    Jelly replied

    Hello,

    You need to place it in the same file.

    Please make sure to clean your cache.

    Best Regards,
    Jelly Team