0
I’m facing a problem. I’ll put in the code and explain what I can’t do.
const interval = setInterval(() => {
const header = document.querySelector('._1QUKR');
if(header) {
clearInterval(interval);
const button = document.createElement("button");
button.innerHTML = "2.5x";
button.classList.add("twoTimesButton");
header.appendChild(button)
//const teste = document.querySelector(".twoTimesButton");
button.addEventListener("click", () => {
const audios = document.querySelectorAll("audio")
audios.forEach(audio => {
console.log(audios)
audio.playbackRate = 2.5
});
})
header.appendChild(button);
}
}, 1000)
This function makes the audio acceleration of Whatsapp. How could I make it turn on and off? That is, click the button and accelerate and then click and return to normal speed. I’ve tried some parole, but I didn’t succeed.
Sensational! That’s what you need, I thought about doing something similar, but I couldn’t structure it. Thank you very much!
– Pedro Victor
Magic, all good. if you can evaluate the thread by voting positive can help more people with this same problem.
– Luciano Alves