File tree Expand file tree Collapse file tree 6 files changed +33
-8
lines changed
Expand file tree Collapse file tree 6 files changed +33
-8
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,10 @@ function sepiaFW_build_audio_recorder(){
3838 var isCordovaAudioinputSupported = undefined ;
3939
4040 function testStreamRecorderSupport ( ) {
41- isMediaDevicesSupported = ! ! AudioContext
42- && ( ( navigator . mediaDevices && navigator . mediaDevices . getUserMedia )
43- || navigator . getUserMedia || navigator . webkitGetUserMedia || navigator . mozGetUserMedia || navigator . msGetUserMedia ) ;
41+ isMediaDevicesSupported = ! ! AudioContext && (
42+ ( navigator . mediaDevices && navigator . mediaDevices . getUserMedia ) ||
43+ navigator . getUserMedia || navigator . webkitGetUserMedia || navigator . mozGetUserMedia || navigator . msGetUserMedia
44+ ) ;
4445 isCordovaAudioinputSupported = ( window . cordova && window . audioinput ) ;
4546 return ! ! isMediaDevicesSupported || isCordovaAudioinputSupported ;
4647 }
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ function sepiaFW_build_strings(){
131131 StringsDE . cant_execute = "Sorry, aber es sieht so aus als könnte ich diese Aktion nicht ausführen." ;
132132 StringsDE . tried_but_not_sure = "Hab's versucht aber bin nicht sicher ob es geklappt hat." ;
133133 StringsDE . result_unclear = "Das Ergebnis der folgenden Anfrage ist unklar." ;
134+ StringsDE . possible_reason_origin_unsecure = "Mögliche Ursache: Unsicherer Ursprung (SSL Zertifikat)" ;
134135 //Service and action texts
135136 StringsDE . opening_link = "Link wird geöffnet." ;
136137 StringsDE . no_music_playing = "Kannst du was hören? Wahrscheinlich wurde keine Musik gefunden." ;
@@ -283,6 +284,7 @@ function sepiaFW_build_strings(){
283284 StringsEN . cant_execute = "Sorry, but it seems I can't execute the requested action." ;
284285 StringsEN . tried_but_not_sure = "I've tried but I'm not sure if it worked." ;
285286 StringsEN . result_unclear = "The result of the following request is unclear." ;
287+ StringsEN . possible_reason_origin_unsecure = "Possible reason: Unsecure origin (SSL certificate)" ;
286288 //Service and action texts
287289 StringsEN . opening_link = "Opening link." ;
288290 StringsEN . no_music_playing = "Can you hear something? Probably no music found." ;
Original file line number Diff line number Diff line change @@ -349,7 +349,13 @@ function sepiaFW_build_speech(){
349349 function broadcastNoAsrSupport ( ) {
350350 //EXAMPLE:
351351 SepiaFW . animate . assistant . idle ( 'asrNoSupport' ) ;
352- SepiaFW . ui . showInfo ( SepiaFW . local . g ( 'noAsrSupport' ) ) ;
352+ var msg = SepiaFW . local . g ( 'noAsrSupport' ) ;
353+ if ( ! SepiaFW . ui . isSecureContext ) {
354+ msg += " " + SepiaFW . local . g ( 'possible_reason_origin_unsecure' )
355+ + " - <a href='https://github.com/SEPIA-Framework/sepia-docs/wiki/SSL-for-your-Server' target=_blank style='color: inherit;'>"
356+ + SepiaFW . local . g ( 'help' ) + "!</a>" ;
357+ }
358+ SepiaFW . ui . showInfo ( msg ) ;
353359 }
354360
355361 //TTS
Original file line number Diff line number Diff line change @@ -75,7 +75,13 @@ function sepiaFW_build_speechWebSocket(){
7575 function broadcastNoAsrSupport ( ) {
7676 //EXAMPLE:
7777 SepiaFW . animate . assistant . idle ( 'asrNoSupport' ) ;
78- SepiaFW . ui . showInfo ( SepiaFW . local . g ( 'noAsrSupport' ) ) ;
78+ var msg = SepiaFW . local . g ( 'noAsrSupport' ) ;
79+ if ( ! SepiaFW . ui . isSecureContext ) {
80+ msg += " " + SepiaFW . local . g ( 'possible_reason_origin_unsecure' )
81+ + " - <a href='https://github.com/SEPIA-Framework/sepia-docs/wiki/SSL-for-your-Server' target=_blank style='color: inherit;'>"
82+ + SepiaFW . local . g ( 'help' ) + "!</a>" ;
83+ }
84+ SepiaFW . ui . showInfo ( msg ) ;
7985 }
8086 function broadcastMissingServerInfo ( ) {
8187 //EXAMPLE:
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ function sepiaFW_build_ui(){
2121 UI . isSafari = false ;
2222 UI . isEdge = false ;
2323
24+ UI . isSecureContext = UI . isCordova ? true : ( ( 'isSecureContext' in window ) ? window . isSecureContext : ( window . location . protocol == "https:" ) ) ;
25+
2426 UI . getPreferredColorScheme = function ( ) {
2527 if ( 'matchMedia' in window ) {
2628 if ( window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ) {
Original file line number Diff line number Diff line change @@ -24,9 +24,13 @@ function sepiaFW_build_wake_word_settings() {
2424 }
2525 }
2626
27- WakeWordSettings . debugLog = function ( info ) {
28- if ( debugInfo ) {
29- $ ( '#sepiaFW-wake-word-audio-info' ) . append ( info + "<br>" ) ;
27+ WakeWordSettings . debugLog = function ( info , isError ) {
28+ if ( debugInfo || isError ) {
29+ if ( isError ) {
30+ $ ( '#sepiaFW-wake-word-audio-info' ) . append ( "<span style='color: #ff0000;'>" + info + "</span><br>" ) ;
31+ } else {
32+ $ ( '#sepiaFW-wake-word-audio-info' ) . append ( info + "<br>" ) ;
33+ }
3034 console . log ( info ) ;
3135 }
3236 }
@@ -130,6 +134,10 @@ function sepiaFW_build_wake_word_settings() {
130134 }
131135 } ) ;
132136 } ) ;
137+
138+ if ( ! SepiaFW . ui . isSecureContext ) {
139+ WakeWordSettings . debugLog ( "Please note: The browser thinks your page origin is NOT secure! Speech recognition might not work properly." , true ) ;
140+ }
133141 }
134142
135143 //ON-OPEN
You can’t perform that action at this time.
0 commit comments