File tree Expand file tree Collapse file tree 6 files changed +39
-16
lines changed Expand file tree Collapse file tree 6 files changed +39
-16
lines changed Original file line number Diff line number Diff line change @@ -28,13 +28,6 @@ detectDemoApp = {
28
28
// options
29
29
this . minHeadScale = 0.015 ;
30
30
this . confidenceThreshold = .98 ;
31
- // detect getUserMedia compatibility
32
- // hide webcam link if not supported
33
- navigator . getUserMedia = navigator . getUserMedia || navigator . webkitGetUserMedia || navigator . mozGetUserMedia || navigator . msGetUserMedia ;
34
- if ( ! navigator . getUserMedia ) {
35
- $ ( ".webcam" ) . hide ( ) ;
36
- $ ( ".ui-buttons .upload" ) . addClass ( "full-width" ) ;
37
- }
38
31
var fileTypeList = [ ] ;
39
32
$ ( this . config . uploadFileTypesImage ) . each ( function ( idx , fileType ) {
40
33
fileTypeList . push ( " ." + fileType . toString ( ) . split ( "/" ) [ 1 ] )
Original file line number Diff line number Diff line change @@ -22,6 +22,21 @@ else {
22
22
$ ( ".options-panel" ) . hide ( ) ;
23
23
}
24
24
25
+ // hide webcam link if Safari or mobile
26
+ var hideWebcam = function ( ) {
27
+ if ( utils . isSafari ( ) || $ ( window ) . width ( ) < 768 ) {
28
+ $ ( ".webcam" ) . hide ( ) ;
29
+ $ ( ".ui-buttons .upload" ) . addClass ( "full-width" ) ;
30
+ } else {
31
+ $ ( ".webcam" ) . show ( ) ;
32
+ $ ( ".ui-buttons .upload" ) . removeClass ( "full-width" ) ;
33
+ }
34
+ }
35
+ hideWebcam ( ) ;
36
+ $ ( window ) . resize ( function ( ) {
37
+ hideWebcam ( ) ;
38
+ } ) ;
39
+
25
40
// show JSON container by default at larger resolutions
26
41
if ( $ ( window ) . width ( ) > 768 ) {
27
42
$ ( ".json-response-container" ) . show ( ) ;
Original file line number Diff line number Diff line change 136
136
<div class="message-container strong">{{message1}}</div>
137
137
<div class="message-container">{{message2}}</div>
138
138
</div>
139
- <div class="response-box-container">
139
+ <!-- < div class="response-box-container">
140
140
{{#if gender}}
141
141
<div class="response-box-gender"></div>
142
142
{{/if}}
143
143
{{#if age}}
144
144
<div class="response-box-age"></div>
145
145
{{/if}}
146
- </div>
146
+ </div> -->
147
147
</script>
148
148
<script id="json-template" type="text/x-handlebars-template">
149
149
<div class="spinner-message-container">
Original file line number Diff line number Diff line change @@ -32,13 +32,6 @@ emoDemoApp = {
32
32
}
33
33
this . captureInterval = 10000 ;
34
34
$ ( "#optionPollTimeout" ) . val ( this . config . pollTimeout ) ;
35
- // detect getUserMedia compatibility
36
- // hide webcam link if not supported
37
- navigator . getUserMedia = navigator . getUserMedia || navigator . webkitGetUserMedia || navigator . mozGetUserMedia || navigator . msGetUserMedia ;
38
- if ( ! navigator . getUserMedia ) {
39
- $ ( ".webcam" ) . hide ( ) ;
40
- $ ( ".ui-buttons .upload" ) . addClass ( "full-width" ) ;
41
- }
42
35
// hide webcam link from Windows platform until supported
43
36
if ( navigator . platform . indexOf ( 'Win' ) > - 1 ) {
44
37
$ ( ".webcam" ) . hide ( ) ;
Original file line number Diff line number Diff line change @@ -23,6 +23,21 @@ else {
23
23
$ ( ".options-panel" ) . hide ( ) ;
24
24
}
25
25
26
+ // hide webcam link if Safari or mobile
27
+ var hideWebcam = function ( ) {
28
+ if ( utils . isSafari ( ) || $ ( window ) . width ( ) < 768 ) {
29
+ $ ( ".webcam" ) . hide ( ) ;
30
+ $ ( ".ui-buttons .upload" ) . addClass ( "full-width" ) ;
31
+ } else {
32
+ $ ( ".webcam" ) . show ( ) ;
33
+ $ ( ".ui-buttons .upload" ) . removeClass ( "full-width" ) ;
34
+ }
35
+ }
36
+ hideWebcam ( ) ;
37
+ $ ( window ) . resize ( function ( ) {
38
+ hideWebcam ( ) ;
39
+ } ) ;
40
+
26
41
$ ( ".video-thumbnail img" ) . eq ( 0 ) . css ( "opacity" , "1" ) ;
27
42
28
43
// show/hide Highcharts tooltip
Original file line number Diff line number Diff line change @@ -339,6 +339,13 @@ utils = {
339
339
return false ;
340
340
}
341
341
return true ;
342
+ } ,
343
+ isSafari : function ( ) {
344
+ is_safari = false ;
345
+ if ( navigator . userAgent . indexOf ( 'Safari' ) != - 1 && navigator . userAgent . indexOf ( 'Chrome' ) == - 1 ) {
346
+ is_safari = true ;
347
+ }
348
+ return is_safari ;
342
349
}
343
350
344
351
}
You can’t perform that action at this time.
0 commit comments