mirror of
https://github.com/photonstorm/phaser
synced 2024-12-17 08:33:40 +00:00
Defined rate property setter to be able to use checkTouchLocked with it
This commit is contained in:
parent
c2f7795a98
commit
865f8d06ad
1 changed files with 15 additions and 0 deletions
|
@ -320,6 +320,21 @@ Object.defineProperty(HTML5AudioSound.prototype, 'volume', {
|
|||
this.emit('volume', this, value);
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Playback rate.
|
||||
*
|
||||
* @name Phaser.Sound.HTML5AudioSound#rate
|
||||
* @property {number} rate
|
||||
*/
|
||||
Object.defineProperty(HTML5AudioSound.prototype, 'rate', {
|
||||
set: function (value) {
|
||||
this.currentConfig.rate = value;
|
||||
if (this.checkTouchLocked('property', 'rate', value)) {
|
||||
return;
|
||||
}
|
||||
Object.getOwnPropertyDescriptor(BaseSound.prototype, 'rate').set.call(this, value);
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Current position of playing sound.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue