Files
nl-im-uniapp/src/components/call/UnifiedCallWindow.vue
2025-12-14 20:55:39 +08:00

46 lines
1.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--
统一音视频通话窗口组件
自动根据平台选择合适的实现:
- H5/App: 使用 WebRTC (CallWindow.vue)
- 微信小程序: 使用 live-pusher/player (MiniProgramCallWindow.vue)
-->
<template>
<!-- #ifdef H5 || APP-PLUS -->
<CallWindow />
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<MiniProgramCallWindow />
<!-- #endif -->
</template>
<script setup lang="ts">
import { onMounted } from 'vue'
// #ifdef H5 || APP-PLUS
import CallWindow from './CallWindow.vue'
import { useWebRTC } from '@/composables/useWebRTC'
const { initListener: initWebRTCListener } = useWebRTC()
// #endif
// #ifdef MP-WEIXIN
import MiniProgramCallWindow from './MiniProgramCallWindow.vue'
import { useMiniProgramCall } from '@/composables/useMiniProgramCall'
const { initListener: initMPListener, initPusherContext } = useMiniProgramCall()
// #endif
onMounted(() => {
// #ifdef H5 || APP-PLUS
initWebRTCListener()
// #endif
// #ifdef MP-WEIXIN
initMPListener()
initPusherContext()
// #endif
})
</script>