Open subsoap opened 3 years ago
If engine sim halts while it's hidden then for stopping audio a separate JS check may be necessary depending on how the audio was played.
If engine sim does halt while it's hidden then it would be better user experience to have a save system which Defold communicates with but is mostly on the JS side which and then save/load user data while these states are detected to better ensure user data is safely saved in most situations. Need to test to know.
This info is useful for detecting the current lifecyle of the KaiOS app. Either for saving data or doing things like stopping audio from playing.
https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilitychange_event
https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState
TODO actually test this to see if document.visiblityState == 'hidden' triggers when screen goes off lets us save data gracefully, I wonder if the engine will stop sim and prevent us to actually save.