diff --git a/docs/uncompiled/artplayer-tool-thumbnail.js b/docs/uncompiled/artplayer-tool-thumbnail.js index 5e2846161..7c5d6a613 100644 --- a/docs/uncompiled/artplayer-tool-thumbnail.js +++ b/docs/uncompiled/artplayer-tool-thumbnail.js @@ -270,6 +270,8 @@ sleep(delay).then(function () { _this3.emit('video', _this3.video); }).catch(function (err) { + _this3.emit('error', err.message); + console.error(err); }); } @@ -309,14 +311,22 @@ }); this.processing = true; runPromisesInSeries(promiseList).then(function () { - sleep(delay * 2).then(function () { + return sleep(delay * 2).then(function () { _this4.processing = false; _this4.emit('done'); }).catch(function (err) { + _this4.processing = false; + + _this4.emit('error', err.message); + console.error(err); }); }).catch(function (err) { + _this4.processing = false; + + _this4.emit('error', err.message); + console.error(err); }); } diff --git a/packages/artplayer-tool-thumbnail/src/index.js b/packages/artplayer-tool-thumbnail/src/index.js index 165a5e78c..5bb56fd86 100644 --- a/packages/artplayer-tool-thumbnail/src/index.js +++ b/packages/artplayer-tool-thumbnail/src/index.js @@ -73,6 +73,7 @@ class ArtplayerToolThumbnail extends Emitter { this.emit('video', this.video); }) .catch(err => { + this.emit('error', err.message); console.error(err); }); } @@ -104,17 +105,21 @@ class ArtplayerToolThumbnail extends Emitter { }); this.processing = true; runPromisesInSeries(promiseList) - .then(() => { + .then(() => sleep(delay * 2) .then(() => { this.processing = false; this.emit('done'); }) .catch(err => { + this.processing = false; + this.emit('error', err.message); console.error(err); - }); - }) + }), + ) .catch(err => { + this.processing = false; + this.emit('error', err.message); console.error(err); }); }