📜  javascript 循环音频列表 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:21.146000             🧑  作者: Mango

代码示例2
let audio = new Audio();
        var playlist = this.state.sequence; // load the sequence of sounds
        audio.src = playlist[0].src; // set the source of the first file in my array
        audio.play(); 
        // when the song ends, load the new sound
        audio.addEventListener('ended', function(){
            // increment playlist[i].src
        }, true);
        audio.loop = false;