feat: 增加清理
This commit is contained in:
parent
130a2b04f1
commit
ba65bed9d2
@ -1,5 +1,5 @@
|
|||||||
import Janus from 'janus-gateway'
|
import Janus from 'janus-gateway'
|
||||||
import { onMounted, ref } from 'vue'
|
import { onMounted, onUnmounted, ref } from 'vue'
|
||||||
import adapter from 'webrtc-adapter'
|
import adapter from 'webrtc-adapter'
|
||||||
|
|
||||||
export {
|
export {
|
||||||
@ -122,6 +122,11 @@ export function useJanus(options) {
|
|||||||
await start()
|
await start()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onUnmounted(async () => {
|
||||||
|
await stop();
|
||||||
|
cleanup();
|
||||||
|
})
|
||||||
|
|
||||||
const StreamPlugin = () => {
|
const StreamPlugin = () => {
|
||||||
const opaqueId = `streamingtest-${Janus.randomString(12)}`
|
const opaqueId = `streamingtest-${Janus.randomString(12)}`
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user