File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ class IatRecorder {
4141 this . appId = config . appId
4242 this . apiKey = config . apiKey
4343 this . apiSecret = config . apiSecret
44- this . isAudioAvailable = ! ! ( navigator . getUserMedia && AudioContext && recorderWorker )
44+ this . isAudioAvailable = ! ! ( ( navigator . getUserMedia || navigator . mediaDevices . getUserMedia ) && AudioContext && recorderWorker )
4545 this . pd = config . pd
4646 this . rlang = config . rlang
4747 this . ptt = config . ptt
@@ -131,6 +131,19 @@ class IatRecorder {
131131 }
132132 this . connectWebsocket ( )
133133 }
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+ }
134147 } else {
135148 alert ( locales [ this . language ] . not_supported )
136149 }
You can’t perform that action at this time.
0 commit comments