X-Git-Url: https://git.r.bdr.sh/rbdr/junction/blobdiff_plain/1d73636a839a4efe8e12cffb33714bc60c58dc4b..b9a2baf2a7c957089e63844b857e05c07b87c2fb:/extension/media.js?ds=sidebyside diff --git a/extension/media.js b/extension/media.js index 33c6fee..5e83ac7 100644 --- a/extension/media.js +++ b/extension/media.js @@ -1,21 +1,19 @@ -'use strict'; - const internals = { - mediaStream: null + mediaStream: null, }; -module.exports = { +export default { async start() { - - internals.mediaStream = internals.mediaStream || await navigator.mediaDevices.getUserMedia({ - audio: true - }); + internals.mediaStream = + internals.mediaStream || + (await navigator.mediaDevices.getUserMedia({ + audio: true, + })); return internals.mediaStream; }, stop() { - if (!internals.mediaStream) { return; } @@ -25,5 +23,5 @@ module.exports = { } internals.mediaStream = null; - } + }, };