Last active
August 29, 2015 14:04
-
-
Save jcmoore/eb59ad20a9937d59bcf1 to your computer and use it in GitHub Desktop.
Auto-replay video
This file contains 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
// | |
window.replay = (function (initial) { | |
var interval = null; | |
return (function repeat (setting) { | |
if (setting && !interval) { | |
interval = setInterval(function () { | |
var button = document.querySelector('[role="button"][aria-label="Replay"]'); | |
event; | |
if (button) { | |
event = document.createEvent("HTMLEvents"); | |
event.initEvent("click", true, true); | |
button.dispatchEvent(event); | |
} | |
}, 500); | |
} else if (!setting && interval) { | |
clearInterval(interval); | |
interval = null; | |
} | |
return repeat; | |
}) (initial); | |
}) (true); //replay(false) | |
// |
This file contains 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
// | |
window.replay=function(a){var b=null;return function c(a){return a&&!b?b=setInterval(function(){var a=document.querySelector('[role="button"][aria-label="Replay"]');a&&(event=document.createEvent("HTMLEvents"),event.initEvent("click",!0,!0),a.dispatchEvent(event))},500):!a&&b&&(clearInterval(b),b=null),c}(a)}(!0); //replay(0) | |
// |
This file contains 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
// | |
javascript:window.replay=function(a){var b=null;return function c(a){return a&&!b?b=setInterval(function(){var a=document.querySelector('[role="button"][aria-label="Replay"]');a&&(event=document.createEvent("HTMLEvents"),event.initEvent("click",!0,!0),a.dispatchEvent(event))},500):!a&&b&&(clearInterval(b),b=null),c}(a)}(!0); //replay(0) | |
// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment