File tree Expand file tree Collapse file tree 5 files changed +24
-6
lines changed
Expand file tree Collapse file tree 5 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 9494 $ newConfig ['login_password ' ] = NULL ;
9595 }
9696
97+ if (!$ newConfig ['previewFromCam ' ]) {
98+ $ newConfig ['previewCamTakesPic ' ] = false ;
99+ }
100+
97101 $ content = "<?php \n\$config = " . var_export (arrayRecursiveDiff ($ newConfig , $ defaultConfig ), true ) . "; " ;
98102
99103 if (file_put_contents ($ my_config_file , $ content )) {
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ function takePicture($filename)
1414 $ demoFolder . $ devImg [array_rand ($ devImg )],
1515 $ filename
1616 );
17- } elseif ($ config ['previewCamTakesPic ' ]) {
17+ } elseif ($ config ['previewFromCam ' ] && $ config [ ' previewCamTakesPic ' ]) {
1818 $ data = $ _POST ['canvasimg ' ];
1919 list ($ type , $ data ) = explode ('; ' , $ data );
2020 list (, $ data ) = explode (', ' , $ data );
Original file line number Diff line number Diff line change 126126 <i class="fa fa-cog fa-spin"></i>
127127 </div>
128128
129- <?php if ($ config ['previewFromCam ' ]): ?>
130129 <video id="video--view" autoplay playsinline></video>
131- <?php endif ; ?>
132130
133131 <div id="counter">
134132 <canvas id="video--sensor"</canvas>
Original file line number Diff line number Diff line change @@ -71,6 +71,8 @@ const photoBooth = (function () {
7171 gallery . find ( '.gallery__inner' ) . hide ( ) ;
7272 $ ( '.spinner' ) . hide ( ) ;
7373 $ ( '.send-mail' ) . hide ( ) ;
74+ $ ( '#video--view' ) . hide ( ) ;
75+ $ ( '#video--sensor' ) . hide ( ) ;
7476 public . resetMailForm ( ) ;
7577 }
7678
@@ -164,9 +166,18 @@ const photoBooth = (function () {
164166 $ ( '<p>' ) . text ( `${ nextCollageNumber + 1 } / ${ config . collage_limit } ` ) . appendTo ( '.cheese' ) ;
165167 }
166168
167- setTimeout ( ( ) => {
168- public . takePic ( photoStyle ) ;
169- } , config . cheese_time ) ;
169+ if ( config . previewFromCam && config . previewCamTakesPic && ! public . stream && ! config . dev ) {
170+ console . log ( 'No preview by device cam available!' ) ;
171+
172+ public . errorPic ( {
173+ error : 'No preview by device cam available!'
174+ } ) ;
175+
176+ } else {
177+ setTimeout ( ( ) => {
178+ public . takePic ( photoStyle ) ;
179+ } , config . cheese_time ) ;
180+ }
170181 }
171182
172183 // take Picture
@@ -247,6 +258,7 @@ const photoBooth = (function () {
247258 $ ( '.spinner' ) . hide ( ) ;
248259 $ ( '.loading' ) . empty ( ) ;
249260 $ ( '.cheese' ) . empty ( ) ;
261+ $ ( '#video--view' ) . hide ( ) ;
250262 $ ( '#video--sensor' ) . hide ( ) ;
251263 loader . addClass ( 'error' ) ;
252264 $ ( '.loading' ) . append ( $ ( '<p>' ) . text ( L10N . error ) ) ;
Original file line number Diff line number Diff line change @@ -212,6 +212,10 @@ input[type="email"] {
212212 p {
213213 margin : 0 0 0.2em ;
214214 }
215+
216+ .btn {
217+ font-size : 0.4em ;
218+ }
215219}
216220
217221.error {
You can’t perform that action at this time.
0 commit comments