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 653434f1008..3b166b044e1 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 @@ -492,20 +492,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 }; @@ -534,10 +534,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 ddf5a7f000d..62abff99e3b 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); } });