feat: 增加清理

This commit is contained in:
wangyu 2023-12-18 09:45:14 +08:00
parent 130a2b04f1
commit ba65bed9d2

View File

@ -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 {