mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2025-01-19 16:11:01 +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) {
|
if (Howl === undefined) {
|
||||||
throw new Error("Howl.js required to created sound controller");
|
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.isMuted = Howler._muted;
|
||||||
this.volume = Howler._volume;
|
this.volume = Howler._volume;
|
||||||
this.tunes = {
|
this.tunes = {
|
||||||
|
@ -70,17 +70,14 @@ class SoundController {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
playGatherMusic (options) {
|
playGatherMusic () {
|
||||||
var self = this;
|
var self = this;
|
||||||
options = options || {};
|
|
||||||
if (!self.gather.playable) return;
|
if (!self.gather.playable) return;
|
||||||
self.gather.music.play();
|
self.gather.music.play();
|
||||||
self.gather.playable = false;
|
self.gather.playable = false;
|
||||||
if (options.throttle === false) {
|
setTimeout(function () {
|
||||||
setTimeout(function () {
|
self.gather.playable = true;
|
||||||
self.gather.playable = true;
|
}, self.minPlayInterval);
|
||||||
}, self.minPlayInterval);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue