修复预览图工具bug

This commit is contained in:
Harvey Zack committed 2018-12-07 20:51:33 +08:00
1 parent 465fb64cda
commit 39301b2e14
4 files changed
+37 -70

No files matched your search

+14 -10
View File
@@ -303,19 +303,23 @@
var promiseList = screenshotDate.map(function (item, index) {
return function () {
_this4.video.currentTime = item.time;
return sleep(delay).then(function () {
context2D.drawImage(_this4.video, item.x, item.y, width, height);
canvas.toBlob(function (blob) {
if (_this4.thumbnailUrl) {
URL.revokeObjectURL(_this4.thumbnailUrl);
}
return new Promise(function (resolve) {
sleep(delay).then(function () {
context2D.drawImage(_this4.video, item.x, item.y, width, height);
canvas.toBlob(function (blob) {
if (_this4.thumbnailUrl) {
URL.revokeObjectURL(_this4.thumbnailUrl);
}
_this4.thumbnailUrl = URL.createObjectURL(blob);
_this4.thumbnailUrl = URL.createObjectURL(blob);
_this4.emit('update', _this4.thumbnailUrl, (index + 1) / number);
_this4.emit('update', _this4.thumbnailUrl, (index + 1) / number);
resolve();
});
}).catch(function (err) {
console.error(err);
});
}).catch(function (err) {
console.error(err);
});
};
});