From 9ee746c9484d9afc7168d3d4398e0e2df1d4b78d Mon Sep 17 00:00:00 2001 From: Jibon Costa Date: Thu, 26 Mar 2020 16:42:54 +0600 Subject: better record start --- background.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'background.js') diff --git a/background.js b/background.js index bc33384..cb2fb8b 100644 --- a/background.js +++ b/background.js @@ -13,6 +13,9 @@ chrome.runtime.onConnect.addListener(port => { case 'REC_STOP': recorder.stop() break + case 'REC_START': + recorder.start(); + break case 'REC_CLIENT_PLAY': if(recorder){ return @@ -70,9 +73,7 @@ chrome.runtime.onConnect.addListener(port => { }, ()=>{ }); } - setTimeout(function(){ - recorder.start(); - }, 3000) + }, error => console.log('Unable to get user media', error)) }) break -- cgit v1.3.1