视频会议
This commit is contained in:
@@ -451,40 +451,70 @@ const swapPrimaryTile = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const onMicToggle = async () => {
|
const onMicToggle = async () => {
|
||||||
if (audioLoading.value || leaving.value) return
|
console.log('[CloudLawVideoCall] onMicToggle clicked', {
|
||||||
|
audioLoading: audioLoading.value,
|
||||||
|
leaving: leaving.value,
|
||||||
|
audioEnabled: audioEnabled.value,
|
||||||
|
localAudioEnabled: meetingStore.localAudioEnabled,
|
||||||
|
localProducerAudio: meetingStore.localProducers?.audio,
|
||||||
|
isInMeeting: meetingStore.isInMeeting
|
||||||
|
})
|
||||||
|
if (audioLoading.value || leaving.value) {
|
||||||
|
console.warn('[CloudLawVideoCall] onMicToggle short-circuited by loading/leaving flag')
|
||||||
|
return
|
||||||
|
}
|
||||||
audioLoading.value = true
|
audioLoading.value = true
|
||||||
try {
|
try {
|
||||||
if (audioEnabled.value) {
|
if (audioEnabled.value) {
|
||||||
|
console.log('[CloudLawVideoCall] -> stopLocalAudio')
|
||||||
await meetingStore.stopLocalAudio()
|
await meetingStore.stopLocalAudio()
|
||||||
|
console.log('[CloudLawVideoCall] stopLocalAudio done')
|
||||||
} else {
|
} else {
|
||||||
|
console.log('[CloudLawVideoCall] -> startLocalAudio')
|
||||||
await meetingStore.startLocalAudio()
|
await meetingStore.startLocalAudio()
|
||||||
|
console.log('[CloudLawVideoCall] startLocalAudio done, localAudioEnabled =', meetingStore.localAudioEnabled)
|
||||||
localMediaError.value = ''
|
localMediaError.value = ''
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('[CloudLawVideoCall] mic toggle failed', err)
|
console.error('[CloudLawVideoCall] mic toggle failed', err)
|
||||||
const msg = err?.message || '麦克风操作失败'
|
const msg = err?.message || '麦克风操作失败'
|
||||||
localMediaError.value = `麦克风:${msg}`
|
localMediaError.value = `麦克风:${msg}`
|
||||||
uni.showModal({ title: '麦克风开启失败', content: msg, showCancel: false })
|
uni.showModal({ title: '麦克风操作失败', content: msg, showCancel: false })
|
||||||
} finally {
|
} finally {
|
||||||
audioLoading.value = false
|
audioLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onCamToggle = async () => {
|
const onCamToggle = async () => {
|
||||||
if (videoLoading.value || leaving.value) return
|
console.log('[CloudLawVideoCall] onCamToggle clicked', {
|
||||||
|
videoLoading: videoLoading.value,
|
||||||
|
leaving: leaving.value,
|
||||||
|
videoEnabled: videoEnabled.value,
|
||||||
|
localVideoEnabled: meetingStore.localVideoEnabled,
|
||||||
|
localProducerVideo: meetingStore.localProducers?.video,
|
||||||
|
isInMeeting: meetingStore.isInMeeting
|
||||||
|
})
|
||||||
|
if (videoLoading.value || leaving.value) {
|
||||||
|
console.warn('[CloudLawVideoCall] onCamToggle short-circuited by loading/leaving flag')
|
||||||
|
return
|
||||||
|
}
|
||||||
videoLoading.value = true
|
videoLoading.value = true
|
||||||
try {
|
try {
|
||||||
if (videoEnabled.value) {
|
if (videoEnabled.value) {
|
||||||
|
console.log('[CloudLawVideoCall] -> stopLocalVideo')
|
||||||
await meetingStore.stopLocalVideo()
|
await meetingStore.stopLocalVideo()
|
||||||
|
console.log('[CloudLawVideoCall] stopLocalVideo done')
|
||||||
} else {
|
} else {
|
||||||
|
console.log('[CloudLawVideoCall] -> startLocalVideo')
|
||||||
await meetingStore.startLocalVideo()
|
await meetingStore.startLocalVideo()
|
||||||
|
console.log('[CloudLawVideoCall] startLocalVideo done, localVideoEnabled =', meetingStore.localVideoEnabled)
|
||||||
localMediaError.value = ''
|
localMediaError.value = ''
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('[CloudLawVideoCall] cam toggle failed', err)
|
console.error('[CloudLawVideoCall] cam toggle failed', err)
|
||||||
const msg = err?.message || '摄像头操作失败'
|
const msg = err?.message || '摄像头操作失败'
|
||||||
localMediaError.value = `摄像头:${msg}`
|
localMediaError.value = `摄像头:${msg}`
|
||||||
uni.showModal({ title: '摄像头开启失败', content: msg, showCancel: false })
|
uni.showModal({ title: '摄像头操作失败', content: msg, showCancel: false })
|
||||||
} finally {
|
} finally {
|
||||||
videoLoading.value = false
|
videoLoading.value = false
|
||||||
}
|
}
|
||||||
@@ -868,4 +898,7 @@ onUnload(() => {
|
|||||||
.clean-video-tile :deep(.tag-self) {
|
.clean-video-tile :deep(.tag-self) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
.clean-video-tile :deep(.tag-host) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user