Skip to content

Instantly share code, notes, and snippets.

@AndrewCraswell
Created July 27, 2017 05:05
Show Gist options
  • Save AndrewCraswell/54ce3b4404a35258fb23bfe60af1c30a to your computer and use it in GitHub Desktop.
Save AndrewCraswell/54ce3b4404a35258fb23bfe60af1c30a to your computer and use it in GitHub Desktop.
(function (plays) {
var i = plays;
var delayInMilliseconds = 5500;
var playBtn = angular.element('.vjs-play-control');
for (i = i; 0 < i; i--) {
setTimeout(function () {
playBtn.click();
console.info('Play successful!');
setTimeout(function () {
playBtn.click();
console.info('Pause successful!');
}, 500);
}, i*delayInMilliseconds);
}
}(100)); // number of times to play
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment