mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-10 15:21:56 +00:00
Remove optional throttling
This commit is contained in:
parent
3ba7c4ecb8
commit
b45b60e822
1 changed files with 5 additions and 8 deletions
|
@ -5,7 +5,7 @@ class SoundController {
|
|||
if (Howl === undefined) {
|
||||
throw new Error("Howl.js required to created sound controller");
|
||||
}
|
||||
this.minPlayInterval = 300000; // 5 minutes
|
||||
this.minPlayInterval = 180000; // 5 minutes
|
||||
this.isMuted = Howler._muted;
|
||||
this.volume = Howler._volume;
|
||||
this.tunes = {
|
||||
|
@ -70,17 +70,14 @@ class SoundController {
|
|||
};
|
||||
}
|
||||
|
||||
playGatherMusic (options) {
|
||||
playGatherMusic () {
|
||||
var self = this;
|
||||
options = options || {};
|
||||
if (!self.gather.playable) return;
|
||||
self.gather.music.play();
|
||||
self.gather.playable = false;
|
||||
if (options.throttle === false) {
|
||||
setTimeout(function () {
|
||||
self.gather.playable = true;
|
||||
}, self.minPlayInterval);
|
||||
}
|
||||
setTimeout(function () {
|
||||
self.gather.playable = true;
|
||||
}, self.minPlayInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue