File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
app/code/Magento/ProductVideo/view/frontend/web/js Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ define([
11
11
] , function ( $ ) {
12
12
'use strict' ;
13
13
14
+ var allowBase = true ; //global var is needed because fotorama always fully reloads events in case of fullscreen
15
+
14
16
/**
15
17
* @private
16
18
*/
@@ -309,13 +311,16 @@ define([
309
311
310
312
if (
311
313
videoItem . mediaType === this . VID && videoItem . isBase &&
312
- this . options . VideoSettings [ 0 ] . playIfBase
314
+ this . options . VideoSettings [ 0 ] . playIfBase && allowBase
313
315
) {
314
316
this . Base = true ;
317
+ allowBase = false ;
315
318
}
316
319
}
317
320
318
- this . _createCloseVideo ( $ ( this . element ) . data ( 'fotorama' ) , this . Base ) ;
321
+ if ( ! this . isFullscreen ) {
322
+ this . _createCloseVideo ( $ ( this . element ) . data ( 'fotorama' ) , this . Base ) ;
323
+ }
319
324
} ,
320
325
321
326
/**
@@ -523,9 +528,11 @@ define([
523
528
this . Base = false ;
524
529
}
525
530
} , this ) , 50 ) ;
526
- } else { //if not a vimeo - play it immediately
527
- $ ( this . element ) . data ( 'fotorama' ) . activeFrame . $stageFrame [ 0 ] . click ( ) ;
528
- this . Base = false ;
531
+ } else { //if not a vimeo - play it immediately with a little lag in case for fotorama fullscreen
532
+ setTimeout ( $ . proxy ( function ( ) {
533
+ $ ( this . element ) . data ( 'fotorama' ) . activeFrame . $stageFrame [ 0 ] . click ( ) ;
534
+ this . Base = false ;
535
+ } , this ) , 50 ) ;
529
536
}
530
537
}
531
538
} ,
You can’t perform that action at this time.
0 commit comments