fix timer resolution

This commit is contained in:
Chris Ham
2018-10-23 11:52:26 -07:00
parent 2476e6a721
commit 159d5a328c
2 changed files with 15 additions and 3 deletions

View File

@@ -52,12 +52,14 @@ function GHOBS(config) {
// resolve Promise with a timer of when the video will finish playback
// trigger user callback when the video finishes
resolve(setTimeout(() => {
let timer = setTimeout(() => {
this.websocket.setSceneItemProperties({"item": video.sceneItem, "visible": false});
if (typeof callback !== 'undefined') {
callback();
}
}, parseInt(video.length*1000)))
}, parseInt(video.length*1000));
resolve(timer);
})
.catch(reject);
});
@@ -79,7 +81,7 @@ function GHOBS(config) {
this.websocket.setCurrentScene({"scene-name": scene})
.then(() => this.playVideo(video, handleVideoEnd))
.then(timer => resolve)
.then(timer => { resolve(timer) })
.catch(reject);
});
};