Created
March 13, 2017 16:59
-
-
Save tushar-borole/06dd040fbb9df6810509ec72626779ed to your computer and use it in GitHub Desktop.
Auto Play audio on the page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment