File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ class IatRecorder {
41
41
this . appId = config . appId
42
42
this . apiKey = config . apiKey
43
43
this . apiSecret = config . apiSecret
44
- this . isAudioAvailable = ! ! ( navigator . getUserMedia && AudioContext && recorderWorker )
44
+ this . isAudioAvailable = ! ! ( ( navigator . getUserMedia || navigator . mediaDevices . getUserMedia ) && AudioContext && recorderWorker )
45
45
this . pd = config . pd
46
46
this . rlang = config . rlang
47
47
this . ptt = config . ptt
@@ -131,6 +131,19 @@ class IatRecorder {
131
131
}
132
132
this . connectWebsocket ( )
133
133
}
134
+ } else if ( navigator . mediaDevices . getUserMedia && AudioContext ) {
135
+ this . state = 'init'
136
+ if ( ! this . recorder ) {
137
+ setTimeout ( ( ) => {
138
+ this . initRecorder ( )
139
+ } , 100 )
140
+ } else {
141
+ if ( this . state === 'end' ) {
142
+ this . closeTrack ( )
143
+ return
144
+ }
145
+ this . connectWebsocket ( )
146
+ }
134
147
} else {
135
148
alert ( locales [ this . language ] . not_supported )
136
149
}
You can’t perform that action at this time.
0 commit comments