BotChat.Speech.SpeechSynthesizer.instance.onIsPlayingChanged is not working properly

42 Views Asked by At

I want enable stop button on SpeechSynthesizer isplaying property is true. So I have used onIsPlayingChanged function. The function calling on change of isplaing property.

BotChat.Speech.SpeechSynthesizer.instance.onIsPlayingChanged = function(newValue, oldValue) {
    const musicStopButton = document.getElementsByClassName("music-stop")[0];
    if (newValue === true) {
        musicStopButton.classList.add("show");
    } else {
        musicStopButton.classList.remove("show");
    }
};

I have tried above mentioned code on more on. nothing is working. Please help me on this issue

0

There are 0 best solutions below