I use a trick to stop [sound:xyz]
audios to play from https://forums.ankiweb.net/t/controlling-display-and-function-of-audio-buttons/10234.
The code likes:
<script>
var elem = document.querySelector(".soundLink, .replaybutton");
if (elem) { elem.click(); }
</script>
It uses a click()
of DOM element generate from [sound:xyz]
to stop the successive audios to play.
Just like I have mentioned above, is there a more direct way to stop the audios instead of call a click()
?
I tried the trick and on my AnkiDroid, and it works just sometimes.
Let’s say that I have [sound:a.mp3]
, [sound:b.mp3]
, [sound:c.mp3]
in my cards. When Don't play audio automatically
is off, the a.mp3
will play automatically, and a click()
call will make a.mp3
play once more and stop the successive b.mp3
and c.mp3
to play. That’s cool but on some of my cards it won’t work and b.mp3
, c.mp3
will still be played.