Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (() => {
- const audios = $('.sm2_button');
- function playAudio(index) {
- if (index === audios.length) return;
- const audio = new Audio();
- audio.src = audios.eq(index).attr('href');
- audio.addEventListener('loadeddata', () => {
- audio.play();
- });
- audio.addEventListener('ended', () => {
- setTimeout(() => playAudio(index + 2), 2000);
- });
- }
- playAudio(0);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement