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> 
  • Apparently through jquery you are doing something like $ ('. audio'). play () on all events, what's on the messages, what's the music. But in general, in order not to strain telepaths, could you give out pieces of code? But now it’s not even clear whether the sound is played in one application. - zb '
  • Messages from another application. - Radik Kamalov
  • those. Does any sound notification from any application in your OS start play in any html5 page in a browser? please describe the platform. OS / browser / version. it's crazy to be honest. - zb '
  • one
    The playback started, just the play button did not update the status. What do you want from PhoneGap ... And this is why it started up - you need to logcat to watch, maybe something will pop up there. - KoVadim
  • one
    Try asking around on the phonegap forums, describe the problem in detail, maybe this is a bug in the android. In general, as far as I understand, html5 audio does not work very well in android. webview browser. - zb '

0