feat: 聊天框与视频功能解耦,输入文字即可开始对话
之前必须点击「开始对话」连接 WebSocket 后才能使用聊天框。 现在聊天输入框始终可用,输入文字自动连接 WebSocket 并发送消息; 左侧按钮改为「开始视频通话」,单独控制摄像头/麦克风。 - ChatPanel 移除 !isConnected early return,始终显示输入框 - useVisionSession 新增待发消息队列,sendTextMessage 支持自动连接 - startSession 改为仅负责视频(摄像头 + 麦克风 + VAD) - 修复 statusRef 在 useWebSocketManager 之前声明导致的 TDZ 错误 - 更新 i18n 翻译(新增 controls.startVideo、video.placeholder)
This commit is contained in:
@@ -33,12 +33,14 @@ export const enUS: TranslationMap = {
|
||||
"video.playing": "🔊 Playing...",
|
||||
"video.initVad": "Initializing voice detection...",
|
||||
"video.clickToStart": "Click the button below to start",
|
||||
"video.placeholder": "Type in the chat panel to start",
|
||||
"video.cameraOff": "Camera is off",
|
||||
"video.cameraOff.hint": "You can type in the chat panel",
|
||||
|
||||
// Controls
|
||||
"controls.connecting": "Connecting...",
|
||||
"controls.start": "🎙️ Start Session",
|
||||
"controls.startVideo": "🎙️ Start Video Call",
|
||||
"controls.cameraOff": "Turn off camera",
|
||||
"controls.cameraOn": "Turn on camera",
|
||||
"controls.micOff": "Turn off microphone",
|
||||
@@ -52,8 +54,8 @@ export const enUS: TranslationMap = {
|
||||
"chat.title": "Chat",
|
||||
"chat.mode.observation": "Observing",
|
||||
"chat.reconnecting": "Connection lost, reconnecting...",
|
||||
"chat.empty.prompt": "Click the button below to start",
|
||||
"chat.empty.hint": "Type or speak with AI after connecting",
|
||||
"chat.empty.prompt": "Type below to start chatting",
|
||||
"chat.empty.hint": "Type to chat with AI, or click the button on the left to start video",
|
||||
"chat.welcome.prompt": "Type below to start chatting",
|
||||
"chat.welcome.hint": "Or enable microphone for voice chat",
|
||||
"chat.userLabel": "You",
|
||||
|
||||
@@ -33,12 +33,14 @@ export const jaJP: TranslationMap = {
|
||||
"video.playing": "🔊 再生中...",
|
||||
"video.initVad": "音声検出を初期化中...",
|
||||
"video.clickToStart": "下のボタンをクリックして開始",
|
||||
"video.placeholder": "右側のチャットに入力して開始",
|
||||
"video.cameraOff": "カメラがオフです",
|
||||
"video.cameraOff.hint": "右側のチャットでテキスト対話ができます",
|
||||
|
||||
// Controls
|
||||
"controls.connecting": "接続中...",
|
||||
"controls.start": "🎙️ 対話を開始",
|
||||
"controls.startVideo": "🎙️ ビデオ通話を開始",
|
||||
"controls.cameraOff": "カメラをオフ",
|
||||
"controls.cameraOn": "カメラをオン",
|
||||
"controls.micOff": "マイクをオフ",
|
||||
@@ -52,8 +54,8 @@ export const jaJP: TranslationMap = {
|
||||
"chat.title": "チャット",
|
||||
"chat.mode.observation": "観察モード",
|
||||
"chat.reconnecting": "接続が切断されました。再接続中...",
|
||||
"chat.empty.prompt": "下のボタンをクリックして開始",
|
||||
"chat.empty.hint": "接続後にテキストまたは音声でAIと対話できます",
|
||||
"chat.empty.prompt": "下にテキストを入力して対話を開始",
|
||||
"chat.empty.hint": "テキストでAIと対話、または左のボタンでビデオ通話を開始",
|
||||
"chat.welcome.prompt": "下にテキストを入力して対話を開始",
|
||||
"chat.welcome.hint": "マイクを有効にして音声対話もできます",
|
||||
"chat.userLabel": "あなた",
|
||||
|
||||
@@ -33,12 +33,14 @@ export const zhCN: TranslationMap = {
|
||||
"video.playing": "🔊 正在播放...",
|
||||
"video.initVad": "正在初始化语音检测...",
|
||||
"video.clickToStart": "点击下方按钮开始对话",
|
||||
"video.placeholder": "在右侧聊天框输入即可开始对话",
|
||||
"video.cameraOff": "摄像头未开启",
|
||||
"video.cameraOff.hint": "可在右侧聊天框打字对话",
|
||||
|
||||
// Controls
|
||||
"controls.connecting": "连接中...",
|
||||
"controls.start": "🎙️ 开始对话",
|
||||
"controls.startVideo": "🎙️ 开始视频通话",
|
||||
"controls.cameraOff": "关闭摄像头",
|
||||
"controls.cameraOn": "开启摄像头",
|
||||
"controls.micOff": "关闭麦克风",
|
||||
@@ -52,8 +54,8 @@ export const zhCN: TranslationMap = {
|
||||
"chat.title": "对话",
|
||||
"chat.mode.observation": "观察模式",
|
||||
"chat.reconnecting": "连接已断开,正在重连...",
|
||||
"chat.empty.prompt": "点击下方按钮开始对话",
|
||||
"chat.empty.hint": "连接后可打字或语音与 AI 交互",
|
||||
"chat.empty.prompt": "在下方输入文字开始对话",
|
||||
"chat.empty.hint": "输入文字即可与 AI 交互,也可点击左侧按钮开启视频",
|
||||
"chat.welcome.prompt": "在下方输入文字开始对话",
|
||||
"chat.welcome.hint": "也可以开启麦克风用语音对话",
|
||||
"chat.userLabel": "你",
|
||||
|
||||
Reference in New Issue
Block a user