Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[proposal] Investigate requestIdleCallback for offscreen tabs #2894

Open
eonarheim opened this issue Jan 20, 2024 · 2 comments
Open

[proposal] Investigate requestIdleCallback for offscreen tabs #2894

eonarheim opened this issue Jan 20, 2024 · 2 comments
Labels
proposal Applied to issues that are a proposal for an implementation

Comments

@eonarheim
Copy link
Member

Context

Currently browsers do not run requestAnimationFrame when browser are minimized/not visible, this is intentional to preserve device battery and prevent abuse.

However it is advantageous to some games to still run some logic (especially multiplayer) during this offscreen state.

Proposal

Investigate a possible mode with requestIdleCallback where game logic can still run while offscreen. It might be possible to modify the excalibur Clock to optionally switch to this other method, it won't be called at the screen refresh rate, but it might be sufficient for offscreen game code.

We should build a proof of concept to see if this is viable.

@eonarheim eonarheim added the proposal Applied to issues that are a proposal for an implementation label Jan 20, 2024
Copy link

This issue hasn't had any recent activity lately and is being marked as stale automatically.

@github-actions github-actions bot added the stale This issue or PR has not had any activity recently label Mar 21, 2024
@mattjennings
Copy link
Contributor

maybe this could be exposed as a separate lifecycle method? onIdleUpdate()?

@github-actions github-actions bot removed the stale This issue or PR has not had any activity recently label Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Applied to issues that are a proposal for an implementation
Projects
None yet
Development

No branches or pull requests

2 participants