Created
January 12, 2011 00:44
-
-
Save geoffb/775473 to your computer and use it in GitHub Desktop.
ImpactJS: Suspend/Resume on blur/focus
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
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