@@ -102,6 +102,7 @@ define([
102
102
FTVC : 'fotorama__video-close' ,
103
103
FTAR : 'fotorama__arr' ,
104
104
isFullscreen : 0 ,
105
+ inFullscreen : false ,
105
106
Base : 0 , //on check for video is base this setting become true if there is any video with base role
106
107
MobileMaxWidth : 767 ,
107
108
GP : 'gallery-placeholder' , //gallery placeholder class is needed to find and erase <script> tag
@@ -113,6 +114,7 @@ define([
113
114
_init : function ( ) {
114
115
if ( this . _checkForVideoExist ( ) ) {
115
116
this . _checkFullscreen ( ) ;
117
+ this . _listenForFullscreen ( ) ;
116
118
this . _checkForVimeo ( ) ;
117
119
this . _isVideoBase ( ) ;
118
120
this . _initFotoramaVideo ( ) ;
@@ -130,6 +132,19 @@ define([
130
132
}
131
133
} ,
132
134
135
+ /**
136
+ *
137
+ * @private
138
+ */
139
+ _listenForFullscreen : function ( ) {
140
+ $ ( this . element ) . on ( 'fotorama:fullscreenenter' , $ . proxy ( function ( ) {
141
+ this . inFullscreen = true ;
142
+ } , this ) ) ;
143
+ $ ( this . element ) . on ( 'fotorama:fullscreenexit' , $ . proxy ( function ( ) {
144
+ this . inFullscreen = false ;
145
+ } , this ) ) ;
146
+ } ,
147
+
133
148
/**
134
149
*
135
150
* @param {Object } inputData
@@ -502,6 +517,13 @@ define([
502
517
$ ( '.' + self . FTAR ) . addClass ( 'hidden-video' ) ;
503
518
}
504
519
} ) ;
520
+
521
+ if ( this . inFullscreen ) {
522
+ $ ( this . element ) . data ( 'fotorama' ) . activeFrame . $stageFrame [ 0 ] . click ( ) ;
523
+ }
524
+ $ ( this . element ) . on ( 'fotorama:fullscreenenter' , $ . proxy ( function ( ) {
525
+ $ ( this . element ) . data ( 'fotorama' ) . activeFrame . $stageFrame [ 0 ] . click ( ) ;
526
+ } , this ) ) ;
505
527
this . _handleBaseVideo ( fotorama , number ) ; //check for video is it base and handle it if it's base
506
528
} ,
507
529
@@ -533,7 +555,13 @@ define([
533
555
} , this ) , 50 ) ;
534
556
} else { //if not a vimeo - play it immediately with a little lag in case for fotorama fullscreen
535
557
setTimeout ( $ . proxy ( function ( ) {
558
+ fotorama . requestFullScreen ( ) ;
536
559
$ ( this . element ) . data ( 'fotorama' ) . activeFrame . $stageFrame [ 0 ] . click ( ) ;
560
+ $ ( '.fotorama__fullscreen-icon' ) . css ( {
561
+ opacity : '1' ,
562
+ visibility : 'visible' ,
563
+ display : 'block'
564
+ } ) ;
537
565
this . Base = false ;
538
566
} , this ) , 50 ) ;
539
567
}
0 commit comments