Defined rate property setter to be able to use checkTouchLocked with it

This commit is contained in:
Pavle Goloskokovic 2018-01-17 17:22:03 +01:00
parent c2f7795a98
commit 865f8d06ad

View file

@ -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.
*