From 156519546f823c3e64b06e413b9708b07c9f3ccb Mon Sep 17 00:00:00 2001 From: Harvey Zack Date: Wed, 5 Dec 2018 16:09:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9B=B4=E5=A4=9A=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/uncompiled/artplayer-tool-thumbnail.js | 12 +++++++++++- packages/artplayer-tool-thumbnail/src/index.js | 11 ++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) 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); }); }