When the app is running, it should keep the CPU awake even when going to sleep and not stop the app. There are permissions for doing so and other apps even have an option in the setting. Technically it is called wake lock.
Otherwise recordings may stop in the middle or not even start when the device's screen is turned off.
Also note that Android 6/7s "battery optimisation" can cause the same problem, but also here you can use a permission to ask the user to turn it off (with one tap by just answering a question). See doze.
Wake lock is already implemented, via a cordova plugin.
Probably need more test for some device having more aggressive sleep mode (like the Sony Android phone)
When the app is running, it should keep the CPU awake even when going to sleep and not stop the app. There are permissions for doing so and other apps even have an option in the setting. Technically it is called wake lock. Otherwise recordings may stop in the middle or not even start when the device's screen is turned off.
Also note that Android 6/7s "battery optimisation" can cause the same problem, but also here you can use a permission to ask the user to turn it off (with one tap by just answering a question). See doze.