mirror of
https://github.com/photonstorm/phaser
synced 2024-11-30 00:21:04 +00:00
Setting startTime based on delay config when calling play method
This commit is contained in:
parent
d6256c47c5
commit
3388fd018f
1 changed files with 4 additions and 0 deletions
|
@ -54,8 +54,12 @@ var HTML5AudioSound = new Class({
|
|||
this.audio.currentTime = offset;
|
||||
this.applyConfig();
|
||||
if (delay === 0) {
|
||||
this.startTime = 0;
|
||||
this.audio.play();
|
||||
}
|
||||
else {
|
||||
this.startTime = window.performance.now() + delay;
|
||||
}
|
||||
this.resetConfig();
|
||||
this.events.dispatch(new SoundEvent(this, 'SOUND_PLAY'));
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue