mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 05:03:37 +00:00
Added method for finding unused audio tag for playing sound
This commit is contained in:
parent
6730b3b314
commit
935ef78102
1 changed files with 13 additions and 0 deletions
|
@ -64,6 +64,19 @@ var HTML5AudioSound = new Class({
|
|||
this.events.dispatch(new SoundEvent(this, 'SOUND_STOP'));
|
||||
return true;
|
||||
},
|
||||
pickAudioTag: function () {
|
||||
if (!this.audio) {
|
||||
for (var i = 0; i < this.tags.length; i++) {
|
||||
var audio = this.tags[i];
|
||||
if (audio.dataset.used === 'false') {
|
||||
audio.dataset.used = 'true';
|
||||
this.audio = audio;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
update: function (time, delta) {
|
||||
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue