Skip to content

Commit ff885e2

Browse files
Added onFocus method to be used when sound resumes when game gains focus
1 parent 381799b commit ff885e2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/sound/html5/HTML5AudioSound.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ var HTML5AudioSound = new Class({
182182
}
183183
this.stopAndReleaseAudioTag();
184184
},
185+
onFocus: function () {
186+
this.isPlaying = true;
187+
this.isPaused = false;
188+
this.pickAndPlayAudioTag();
189+
},
185190
update: function (time, delta) {
186191
// TODO include play method call delay
187192
if (this.isPlaying) {

0 commit comments

Comments
 (0)