Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
Fix Cannot read property 'createMediaStreamSource' of null
Browse files Browse the repository at this point in the history
  • Loading branch information
curtgrimes committed Jun 2, 2021
1 parent b83b422 commit 2e7bda2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/components/VolumeMeter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,21 @@ export default {
});
audioContext = new AudioContext();
await audioContext.audioWorklet.addModule(
'/static/captioner/volume-meter-module.js'
);
if (!audioContext) {
// We can't continue
return;
}
try {
await audioContext.audioWorklet.addModule(
'/static/captioner/volume-meter-module.js'
);
} catch (e) {
// We can't continue
return;
}
let microphone = audioContext.createMediaStreamSource(stream);
node = new AudioWorkletNode(audioContext, 'volume-meter');
Expand Down

0 comments on commit 2e7bda2

Please sign in to comment.