From 120368f4c11bb532ae7bd87b486293658a7d32fd Mon Sep 17 00:00:00 2001 From: Siarhei Ivanouski Date: Thu, 28 Dec 2017 23:16:21 +0100 Subject: [PATCH] Release stream tracks and close audioContext on stop recording --- src/js/plugins/lamejs-plugin.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/js/plugins/lamejs-plugin.js b/src/js/plugins/lamejs-plugin.js index 6098f99a..bd70bc01 100644 --- a/src/js/plugins/lamejs-plugin.js +++ b/src/js/plugins/lamejs-plugin.js @@ -54,6 +54,8 @@ class LamejsEngine extends RecordEngine { this.audioSourceNode.disconnect(); this.processor.disconnect(); this.processor.onaudioprocess = null; + this.inputStream.getAudioTracks().forEach(track => track.stop()) + this.audioContext.close() this.engine.postMessage({cmd: 'finish'}); }