case-insensitive commands, ttas vods, start/stop delay support

This commit is contained in:
Chris Ham
2018-11-13 17:17:23 -08:00
parent fd75d11eec
commit 6e36e06ce9
3 changed files with 39 additions and 8 deletions

View File

@@ -22,10 +22,15 @@ function FGFM(config) {
// @TODO: Move these defaults to config
if (typeof streamStartDelaySeconds === 'undefined') {
streamStartDelaySeconds = 1;
} else {
streamStartDelaySeconds = parseInt(streamStartDelaySeconds);
}
if (typeof showStartDelaySeconds === 'undefined') {
showStartDelaySeconds = 300;
} else {
showStartDelaySeconds = parseInt(showStartDelaySeconds);
showStartDelaySeconds += streamStartDelaySeconds;
}
this.state.showStatus = 'STARTING_SOON';
@@ -39,10 +44,11 @@ function FGFM(config) {
// Restore volume
this.obs.setVolume('headphones', 1.0);
// Start the stream
// Start the stream after delay
console.log(`The stream will start in ${streamStartDelaySeconds} seconds!`);
setTimeout(() => {this.obs.startStream().then(() => {this.emit('STREAM_STARTED')})}, streamStartDelaySeconds*1000);
// Start the "show" after stream+show delay
// @TODO: Actually show the countdown in the scene
console.log(`The show will start in ${showStartDelaySeconds} seconds!`);
setTimeout(this.startTheShow, showStartDelaySeconds*1000);