Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ImpactJS: Suspend/Resume on blur/focus
window.addEventListener("blur", function () {
if (ig.system) {
ig.music.stop();
ig.system.stopRunLoop();
}
}, false);
window.addEventListener("focus", function () {
if (ig.system) {
ig.music.play();
ig.system.startRunLoop();
}
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.