fix timer resolution
This commit is contained in:
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user