tushariscoolster
3/13/2017 - 4:59 PM

Auto Play audio on the page

Auto Play audio on the page

var audioArray=$( "audio" )
audioArray.each(function( index ,value) {
    value.onended = function() {
        if(audioArray[index+1]){
            audioArray[index+1].play()
        }else{
            audioArray[0].play()
        }
    };
    value.onplay = function() {
        console.log("The video has started to play",index);
    };
});