You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for pausing and unpausing the emulator
When the emulator polls for input, if we're paused, we block until it
is unpaused. In the case of the SharedArrayBuffer input mode, we can
use Atomics.wait and Atomics.notify to do this relatively efficiently.
Even for the fallback mode we can avoid polling by not resolving the
command fetching request until the input in unpaused.
Use this to expose pause/unpause functionality in the embedded mode in
few ways:
- The frame will listen for emulator_pause and emulator_unpause
postMessage events.
- The embed URL can have a paused=true query parameter to allow it to
start paused.
- The embed URL can also have an auto_pause=true query parameter to
automatically pause when the emulator is not visible. This is done by
checking the visibility of the iframe document, as well as the
visibility of the screen canvas (via IntersectionObserver).
Updates #382
0 commit comments