From 5bac960bc0f3a5ae0d65bf237544119b6aba2cfe Mon Sep 17 00:00:00 2001 From: pini-girit Date: Wed, 19 Dec 2018 17:06:52 +0200 Subject: [PATCH] CLOUDINARY-43,CLOUDINARY-44: Fixed Product Video Thumbnail --- view/adminhtml/web/js/get-video-information.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/view/adminhtml/web/js/get-video-information.js b/view/adminhtml/web/js/get-video-information.js index 8bbeb8e..6e5f17d 100644 --- a/view/adminhtml/web/js/get-video-information.js +++ b/view/adminhtml/web/js/get-video-information.js @@ -594,14 +594,7 @@ define([ context = (tmp.context && tmp.context.custom) ? tmp.context.custom : {}; tmp.derived = tmp.derived || []; - thumbnail = this.options.cloudinaryPlaceholder; - thumbnail_bytes = 0; - tmp.derived.forEach(function(derivedItem) { - if (derivedItem.bytes && derivedItem.bytes > thumbnail_bytes) { - thumbnail_bytes = derivedItem.bytes; - thumbnail = (videoInfo.videoSrc.indexOf('https') === 0) ? derivedItem.secure_url : derivedItem.url; - } - }); + thumbnail = videoInfo.videoSrc.replace(/\.[^/.]+$/, "").replace(/\/([^\/]+)$/, '/so_auto/$1.jpg') || this.options.cloudinaryPlaceholder; respData = { duration: 'unknown',