Application created using phonegap. On the page one put the audio. I pause, and even if I minimize the application, and someone will write a message to me and a notification sound will come out, then the audio in the application starts to play. At what the key shows that the audio is still on pause. How to get rid of this bug?
I checked that with any sound notification the audio continues to sing. Those. one sound starts another. If you rearrange the phone in silent mode, then all the rules.
<audio preload="none" controls ontimeupdate="if (this.duration == this.currentTime) {this.currentTime = 0; this.pause()} " id = "audio'+i+'" src="file:///sdcard/Download/Tur/1.mp3"></audio> <button id = "vklvikl" onclick = "if (!audio'+[i]+') {document.getElementById(\'audio'+i+'\').play(); audio'+[i]+'= true;} else {document.getElementById(\'audio'+i+'\').pause(); audio'+[i]+'= false;}"> play/pause</button>