-'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;
}
}
internals.mediaStream = null;
- }
+ },
};