-module.exports = {
- async start() {
-
- internals.mediaStream = internals.mediaStream || await navigator.mediaDevices.getUserMedia({
- audio: true
- });
-
- return internals.mediaStream;
- },
-
- stop() {
+export async function startMedia() {
+ internals.mediaStream =
+ internals.mediaStream ||
+ (await navigator.mediaDevices.getUserMedia({
+ audio: true,
+ }));