File tree Expand file tree Collapse file tree 3 files changed +20
-10
lines changed
app/code/Magento/ProductVideo Expand file tree Collapse file tree 3 files changed +20
-10
lines changed Original file line number Diff line number Diff line change 14
14
<value id =" google_video" type =" host" >www.googleapis.com</value >
15
15
<value id =" vimeo" type =" host" >vimeo.com</value >
16
16
<value id =" www_vimeo" type =" host" >www.vimeo.com</value >
17
+ <value id =" vimeo_cdn" type =" host" >*.vimeocdn.com</value >
17
18
</values >
18
19
</policy >
19
20
<policy id =" img-src" >
20
21
<values >
21
22
<value id =" vimeo_cdn" type =" host" >*.vimeocdn.com</value >
22
23
</values >
23
24
</policy >
25
+ <policy id =" frame-src" >
26
+ <values >
27
+ <value id =" player_vimeo" type =" host" >player.vimeo.com</value >
28
+ </values >
29
+ </policy >
24
30
</policies >
25
31
</csp_whitelist >
Original file line number Diff line number Diff line change @@ -492,20 +492,20 @@ define([
492
492
var tmp ,
493
493
respData ;
494
494
495
- if ( data . length < 1 ) {
495
+ if ( ! data ) {
496
496
this . _onRequestError ( $ . mage . __ ( 'Video not found' ) ) ;
497
497
498
498
return null ;
499
499
}
500
- tmp = data [ 0 ] ;
500
+ tmp = data ;
501
501
respData = {
502
502
duration : this . _formatVimeoDuration ( tmp . duration ) ,
503
- channel : tmp [ 'user_name ' ] ,
504
- channelId : tmp [ 'user_url ' ] ,
503
+ channel : tmp [ 'author_name ' ] ,
504
+ channelId : tmp [ 'author_url ' ] ,
505
505
uploaded : tmp [ 'upload_date' ] ,
506
506
title : tmp . title ,
507
507
description : tmp . description . replace ( / ( & n b s p ; | < ( [ ^ > ] + ) > ) / ig, '' ) ,
508
- thumbnail : tmp [ 'thumbnail_large ' ] ,
508
+ thumbnail : tmp [ 'thumbnail_url ' ] ,
509
509
videoId : videoInfo . id ,
510
510
videoProvider : videoInfo . type
511
511
} ;
@@ -534,10 +534,11 @@ define([
534
534
) ;
535
535
} else if ( type === 'vimeo' ) {
536
536
$ . ajax ( {
537
- url : 'https://www. vimeo.com/api/v2/video/' + id + ' .json',
537
+ url : 'https://vimeo.com/api/oembed .json' ,
538
538
dataType : 'jsonp' ,
539
539
data : {
540
- format : 'json'
540
+ format : 'json' ,
541
+ url : 'https://vimeo.com/' + id
541
542
} ,
542
543
timeout : 5000 ,
543
544
success : $ . proxy ( _onVimeoLoaded , self ) ,
Original file line number Diff line number Diff line change @@ -858,13 +858,16 @@ fotoramaVersion = '4.6.4';
858
858
dataFrame . thumbsReady = true ;
859
859
} else if ( video . type === 'vimeo' ) {
860
860
$ . ajax ( {
861
- url : getProtocol ( ) + 'vimeo.com/api/v2/video/' + video . id + '.json' ,
861
+ url : getProtocol ( ) + 'vimeo.com/api/oembed.json' ,
862
+ data : {
863
+ url : 'https://vimeo.com/' + video . id
864
+ } ,
862
865
dataType : 'jsonp' ,
863
866
success : function ( json ) {
864
867
dataFrame . thumbsReady = true ;
865
868
updateData ( data , {
866
- img : json [ 0 ] . thumbnail_large ,
867
- thumb : json [ 0 ] . thumbnail_small
869
+ img : json [ 0 ] . thumbnail_url ,
870
+ thumb : json [ 0 ] . thumbnail_url
868
871
} , dataFrame . i , fotorama ) ;
869
872
}
870
873
} ) ;
You can’t perform that action at this time.
0 commit comments