fix timer
This commit is contained in:
parent
ed5a7771af
commit
596e7d1c3b
1 changed files with 6 additions and 1 deletions
|
@ -11,7 +11,7 @@ import IconButton from '../../../atoms/button/IconButton';
|
||||||
import './VoiceMailRecorder.scss';
|
import './VoiceMailRecorder.scss';
|
||||||
import Timer from '../../../../util/Timer';
|
import Timer from '../../../../util/Timer';
|
||||||
|
|
||||||
let timer = new Timer();
|
let timer;
|
||||||
|
|
||||||
let _stream;
|
let _stream;
|
||||||
let _mediaRecorder;
|
let _mediaRecorder;
|
||||||
|
@ -22,6 +22,11 @@ const audioChunks = [];
|
||||||
async function init() {
|
async function init() {
|
||||||
if (_mediaRecorder) return;
|
if (_mediaRecorder) return;
|
||||||
|
|
||||||
|
timer = new Timer();
|
||||||
|
_stream = null;
|
||||||
|
_mediaRecorder = null;
|
||||||
|
audioChunks.length = 0;
|
||||||
|
|
||||||
console.log('record voice, new recorder');
|
console.log('record voice, new recorder');
|
||||||
_stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
_stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue