Sometimes user needs to click on the canvas to start the emulation (Autoplay policy?) #41
-
This might be similar to someone's question in the issues section. Sometimes, after starting emulation via await Nostalgist.launch(...), the emulation launches but does not start until the user clicks or taps on the emulator canvas. The screen doesn't necessarily remain black - sometimes it's a different color (perhaps the first frame of the emulated image?). I assume this isn't a bug but rather a browser security measure against autoplay, as this situation usually occurs when there’s a longer delay between clicking the element that starts the emulation and loading all files (more than a few seconds), though not every time. Is it possible to detect this situation (e.g., in the onLaunch callback) to display a notification? This would help avoid always informing the user that they need to click, as in most cases, the emulation starts automatically. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You are right :) We cannot bypass it.
Unfortunately we can't detect whether is this happening. And different browsers on different platforms have different limitations about the time between user actions and autoplay of media. Basically, there are two ways to deal with this problem.
|
Beta Was this translation helpful? Give feedback.
You are right :) We cannot bypass it.
Unfortunately we can't detect whether is this happening. And different browsers on different platforms have different limitations about the time between user actions and autoplay of media.
Basically, there are two ways to deal with this problem.
Separate the fetching process of ROM/core files from the launching call, so when the user clicks something, we can guarantee that the related files have already been loaded.
Example: