diff --git a/vendor/magento/module-product-video/etc/csp_whitelist.xml b/vendor/magento/module-product-video/etc/csp_whitelist.xml index ca453605710..2e091440330 100644 --- a/vendor/magento/module-product-video/etc/csp_whitelist.xml +++ b/vendor/magento/module-product-video/etc/csp_whitelist.xml @@ -14,6 +14,7 @@ www.googleapis.com vimeo.com www.vimeo.com + *.vimeocdn.com @@ -21,5 +22,10 @@ *.vimeocdn.com + + + player.vimeo.com + + diff --git a/vendor/magento/module-product-video/view/adminhtml/web/js/get-video-information.js b/vendor/magento/module-product-video/view/adminhtml/web/js/get-video-information.js index cb56a085304..4b3c1b7f8ee 100644 --- a/vendor/magento/module-product-video/view/adminhtml/web/js/get-video-information.js +++ b/vendor/magento/module-product-video/view/adminhtml/web/js/get-video-information.js @@ -497,20 +497,20 @@ define([ var tmp, respData; - if (data.length < 1) { + if (!data) { this._onRequestError($.mage.__('Video not found')); return null; } - tmp = data[0]; + tmp = data; respData = { duration: this._formatVimeoDuration(tmp.duration), - channel: tmp['user_name'], - channelId: tmp['user_url'], + channel: tmp['author_name'], + channelId: tmp['author_url'], uploaded: tmp['upload_date'], title: tmp.title, description: tmp.description.replace(/( |<([^>]+)>)/ig, ''), - thumbnail: tmp['thumbnail_large'], + thumbnail: tmp['thumbnail_url'], videoId: videoInfo.id, videoProvider: videoInfo.type }; @@ -539,10 +539,11 @@ define([ ); } else if (type === 'vimeo') { $.ajax({ - url: 'https://www.vimeo.com/api/v2/video/' + id + '.json', + url: 'https://vimeo.com/api/oembed.json', dataType: 'jsonp', data: { - format: 'json' + format: 'json', + url: 'https://vimeo.com/' + id }, timeout: 5000, success: $.proxy(_onVimeoLoaded, self), diff --git a/lib/web/fotorama/fotorama.js b/lib/web/fotorama/fotorama.js index 314949bd2f4..f268c9aa736 100644 --- a/lib/web/fotorama/fotorama.js +++ b/lib/web/fotorama/fotorama.js @@ -858,13 +858,16 @@ fotoramaVersion = '4.6.4'; dataFrame.thumbsReady = true; } else if (video.type === 'vimeo') { $.ajax({ - url: getProtocol() + 'vimeo.com/api/v2/video/' + video.id + '.json', + url: getProtocol() + 'vimeo.com/api/oembed.json', + data: { + url: 'https://vimeo.com/' + video.id + }, dataType: 'jsonp', success: function (json) { dataFrame.thumbsReady = true; updateData(data, { - img: json[0].thumbnail_large, - thumb: json[0].thumbnail_small + img: json[0].thumbnail_url, + thumb: json[0].thumbnail_url }, dataFrame.i, fotorama); } });