Skip to content

Instantly share code, notes, and snippets.

@geoffb
Created January 12, 2011 00:44
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save geoffb/775473 to your computer and use it in GitHub Desktop.
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