vrmode timer, user skip voting

This commit is contained in:
Chris Ham
2018-10-30 19:12:57 -07:00
parent b86e2f102f
commit d01439cf15
5 changed files with 141 additions and 29 deletions

View File

@@ -157,7 +157,8 @@ function FGFM(config) {
// Also handles "commercial breaks" if enabled
this.nextVideo = () => {
// @TODO: Validate this.state.showStatus -- make sure the "show" hasn't been paused or stopped
if (this.state.showStatus === 'ENDING' || this.state.showStatus === 'ENDED') {
let ignoreStates = ['ENDING', 'ENDED', 'PAUSED'];
if (ignoreStates.includes(this.state.showStatus)) {
return;
}
@@ -282,7 +283,16 @@ function FGFM(config) {
// Clears.. the... queue
this.clearQueue = () => {
this.state.videoQueue = [];
}
};
this.pause = () => {
this.state.showStatus = 'PAUSED';
};
this.resume = () => {
this.state.showStatus = 'RUNNING';
this.nextVideo();
};
}
module.exports = FGFM;