If you press the back button and exit the app, it will continue in the background.

Asked 2 years ago, Updated 2 years ago, 86 views

It became cordova 4.1 in monaca, but if you choose this one,
It seems that the application is running in the background when the Android back button is pulled out.
BGM, regular sound effects will be heard as the game progresses.
It can be debugger or build.
*If you delete the application history, it will stop

It wasn't like that before.
You must drop the cordova to 3.5 and build it

Is it because I make it with ent.js?
I tried to end the game after pressing the back button, but
It didn't improve...
Of course, my back button event may not be working properly, but

Please let me know if you know how to deal with it

android monaca cordova

2022-09-30 19:18

1 Answers

Try writing pause and playback to pause and resume events in document.addEventListener as follows:

 document.addEventListener("pause", function() {bgm.pause();}, false);
document.addEventListener("resume", function() {bgm.play();}, false);


2022-09-30 19:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.