feat(CallScreen): enhance video call functionality and UI updates
Some checks failed
Frontend CI / build-and-push-web (push) Successful in 3m13s
Frontend CI / build-android-apk (push) Has been cancelled
Frontend CI / ota-android (push) Has been cancelled

- Integrated video call support by adding local and remote video stream handling.
- Implemented state management for video track detection in both local and peer streams.
- Updated UI to conditionally render video components based on the presence of video tracks.
- Added video toggle functionality to enable or disable local video during calls.
- Enhanced incoming call modal to display call type (voice or video).
- Refactored call store to manage call types and video state more effectively.
This commit is contained in:
lafay
2026-03-28 00:56:52 +08:00
parent b19a2ced6f
commit f6176c945b
11 changed files with 790 additions and 268 deletions

View File

@@ -26,7 +26,7 @@ import { messageService } from '../../../../services/messageService';
import { uploadService } from '../../../../services/uploadService';
import { ApiError } from '../../../../services/api';
// 【新架构】使用 MessageManager
import { useChat, useGroupTyping, useGroupMuted, messageManager } from '../../../../stores';
import { useChat, useGroupTyping, useGroupMuted, messageManager, callStore } from '../../../../stores';
import { groupService } from '../../../../services/groupService';
import { userManager } from '../../../../stores/userManager';
import { groupManager } from '../../../../stores/groupManager';
@@ -1060,6 +1060,24 @@ export const useChatScreen = () => {
// 处理更多功能
const handleMoreAction = useCallback((actionId: string) => {
switch (actionId) {
case 'voice_call':
if (!isGroupChat && otherUser?.id && conversationId) {
callStore.getState().startCall(conversationId, otherUser.id, {
nickname: otherUser.nickname,
avatar: otherUser.avatar,
}, 'voice');
}
setActivePanel('none');
break;
case 'video_call':
if (!isGroupChat && otherUser?.id && conversationId) {
callStore.getState().startCall(conversationId, otherUser.id, {
nickname: otherUser.nickname,
avatar: otherUser.avatar,
}, 'video');
}
setActivePanel('none');
break;
case 'image':
handlePickImage();
break;
@@ -1077,7 +1095,7 @@ export const useChatScreen = () => {
default:
setActivePanel('none');
}
}, [handlePickImage, handleTakePhoto]);
}, [handlePickImage, handleTakePhoto, isGroupChat, otherUser, conversationId]);
// 插入表情
const handleInsertEmoji = useCallback((emoji: string) => {