From f931f0dda2398cb6d6af6be5a5a234b252d67493 Mon Sep 17 00:00:00 2001 From: Harvey Zack Date: Thu, 6 Dec 2018 21:44:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20gif=20=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/uncompiled/artplayer-plugin-gif.js | 9 +++------ packages/artplayer-plugin-gif/src/index.js | 8 +++----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/docs/uncompiled/artplayer-plugin-gif.js b/docs/uncompiled/artplayer-plugin-gif.js index 18ef8c67d..d5867c8fa 100644 --- a/docs/uncompiled/artplayer-plugin-gif.js +++ b/docs/uncompiled/artplayer-plugin-gif.js @@ -2744,8 +2744,7 @@ var _art$constructor$util = art.constructor.utils, errorHandle = _art$constructor$util.errorHandle, clamp = _art$constructor$util.clamp, - downloadImage = _art$constructor$util.downloadImage, - sleep = _art$constructor$util.sleep; + downloadImage = _art$constructor$util.downloadImage; var i18n = art.i18n, notice = art.notice, layers = art.layers, @@ -2801,9 +2800,7 @@ gifHeight: 200, gifWidth: videoWidth / videoHeight * 200 }, function (image) { - sleep(100).then(function () { - downloadImage(image, "".concat(title || 'unnamed', ".gif")); - }); + downloadImage(image, "".concat(title || 'unnamed', ".gif")); }); } } @@ -2851,7 +2848,7 @@ loading.show(); art.emit('artplayerPluginGif:start'); notice.show(i18n.get('Start creating gif...'), false); - console.log("Start time: ".concat(config.offset || 0, " s, Duration: ").concat(config.numFrames / 10 || 1)); + console.log("Start time: ".concat(config.offset || 0, "s, Frames: ").concat(config.numFrames || 10, "p, Duration: ").concat(config.numFrames / 10 || 1, "s")); gifshot.createGIF(objectSpread({}, config, { video: [$video.src], crossOrigin: 'Anonymous' diff --git a/packages/artplayer-plugin-gif/src/index.js b/packages/artplayer-plugin-gif/src/index.js index 7161f44f7..e6af20acb 100644 --- a/packages/artplayer-plugin-gif/src/index.js +++ b/packages/artplayer-plugin-gif/src/index.js @@ -22,7 +22,7 @@ function i18nMix(i18n) { } function artplayerPluginGif(art) { - const { errorHandle, clamp, downloadImage, sleep } = art.constructor.utils; + const { errorHandle, clamp, downloadImage } = art.constructor.utils; const { i18n, notice, @@ -81,9 +81,7 @@ function artplayerPluginGif(art) { gifWidth: (videoWidth / videoHeight) * 200, }, image => { - sleep(100).then(() => { - downloadImage(image, `${title || 'unnamed'}.gif`); - }); + downloadImage(image, `${title || 'unnamed'}.gif`); }, ); } @@ -130,7 +128,7 @@ function artplayerPluginGif(art) { loading.show(); art.emit('artplayerPluginGif:start'); notice.show(i18n.get('Start creating gif...'), false); - console.log(`Start time: ${config.offset || 0} s, Duration: ${config.numFrames / 10 || 1}`); + console.log(`Start time: ${config.offset || 0}s, Frames: ${config.numFrames || 10}p, Duration: ${config.numFrames / 10 || 1}s`); gifshot.createGIF( { ...config,