Added onFocus method to be used when sound resumes when game gains focus

This commit is contained in:
Pavle Goloskokovic 2018-01-14 15:37:38 +01:00
parent 381799b040
commit ff885e2ead

View file

@ -182,6 +182,11 @@ var HTML5AudioSound = new Class({
}
this.stopAndReleaseAudioTag();
},
onFocus: function () {
this.isPlaying = true;
this.isPaused = false;
this.pickAndPlayAudioTag();
},
update: function (time, delta) {
// TODO include play method call delay
if (this.isPlaying) {