From ba65bed9d2f13e67eb1f114b0afa507b390494c7 Mon Sep 17 00:00:00 2001 From: wangyu <727842003@qq.com> Date: Mon, 18 Dec 2023 09:45:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/janus/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/janus/index.js b/src/core/janus/index.js index 28432d6..225cd00 100644 --- a/src/core/janus/index.js +++ b/src/core/janus/index.js @@ -1,5 +1,5 @@ import Janus from 'janus-gateway' -import { onMounted, ref } from 'vue' +import { onMounted, onUnmounted, ref } from 'vue' import adapter from 'webrtc-adapter' export { @@ -122,6 +122,11 @@ export function useJanus(options) { await start() }) + onUnmounted(async () => { + await stop(); + cleanup(); + }) + const StreamPlugin = () => { const opaqueId = `streamingtest-${Janus.randomString(12)}` return {