mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 14:40:38 +00:00
Setting sound position, applying config and starting playback if delay is set to 0 when calling play method
This commit is contained in:
parent
11923621ad
commit
82819ec782
1 changed files with 9 additions and 0 deletions
|
@ -38,6 +38,15 @@ var HTML5AudioSound = new Class({
|
|||
this.reset();
|
||||
return false;
|
||||
}
|
||||
var seek = this.currentConfig.seek;
|
||||
var delay = this.currentConfig.delay;
|
||||
var offset = (this.currentMarker ? this.currentMarker.start : 0) + seek;
|
||||
this.audio.currentTime = offset;
|
||||
this.applyConfig();
|
||||
if (delay === 0) {
|
||||
this.audio.play();
|
||||
}
|
||||
this.resetConfig();
|
||||
this.events.dispatch(new SoundEvent(this, 'SOUND_PLAY'));
|
||||
return true;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue