Okay
  Public Ticket #2827023
Sticky player pause via javascript
Closed

Comments

  • JW started the conversation

    I'm able to get IRON.sonaar.player.play() to work via javascript, but when I try to use IRON.sonaar.player.pause(), I get an error that it not a function.

    Are there updated docs available to handle play / pause via javascript? 

    Also, is there a way to do it with the document.getElementById('sonaar-audio') method?

  •  647
    Alexandre replied

    Hi JW, 

    The IRON.sonaar.player.play() toggle between play and pause.

    If you want a function to do only "pause" please got with:
    document.getElementById("sonaar-audio").pause();

    You can also do play with:
    document.getElementById("sonaar-audio").play();


    And if you are changing the wave type to "dynamic", you can use
    IRON.sonaar.player.wavesurfer.pause();
    IRON.sonaar.player.wavesurfer.play();

    Thanks,


    Alexandre from the Sonaar.io Crew