prendy
Version:
Make games with prerendered backdrops using babylonjs and repond
12 lines (10 loc) • 399 B
text/typescript
import { getRefs, getState } from "repond";
export function updateAppVisibility(event: Event) {
if (document.visibilityState === "visible") {
getRefs().global.main.gameIsInBackground = false;
// handlePausingVideoWhenHidden(false);
} else if (document.visibilityState === "hidden") {
getRefs().global.main.gameIsInBackground = true;
// handlePausingVideoWhenHidden(true);
}
}