fix: 视频指示牌显示文件名,多视频显示'2个视频'
This commit is contained in:
@@ -185,7 +185,9 @@ export function appendMessageDOM(msg: ChatMessage, index: number): void {
|
|||||||
|
|
||||||
if ((msg as any)._videoFrames && (msg as any)._videoFrames.length > 0) {
|
if ((msg as any)._videoFrames && (msg as any)._videoFrames.length > 0) {
|
||||||
const n = (msg as any)._videoFrames.length;
|
const n = (msg as any)._videoFrames.length;
|
||||||
contentHtml += `<div class="msg-video-indicator">🎬 视频帧序列 · ${n} 帧 · 1fps</div>`;
|
const name = (msg as any)._videoMeta?.fileName || '';
|
||||||
|
const label = name ? `${name} · ` : '';
|
||||||
|
contentHtml += `<div class="msg-video-indicator">🎬 ${label}${n} 帧 · 1fps</div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.files && msg.files.length > 0) {
|
if (msg.files && msg.files.length > 0) {
|
||||||
|
|||||||
@@ -1032,7 +1032,11 @@ async function sendMessageWithAgentLoop(text: string, currentSession: ChatSessio
|
|||||||
if (allVids.length > 0) {
|
if (allVids.length > 0) {
|
||||||
const totalFrames = allVids.flatMap(v => v.frames);
|
const totalFrames = allVids.flatMap(v => v.frames);
|
||||||
msg._videoFrames = totalFrames;
|
msg._videoFrames = totalFrames;
|
||||||
msg._videoMeta = { fileName: allVids[0].name, duration: allVids[0].dur, frameCount: totalFrames.length };
|
msg._videoMeta = {
|
||||||
|
fileName: allVids.length === 1 ? allVids[0].name : `${allVids.length}个视频`,
|
||||||
|
duration: allVids[0].dur,
|
||||||
|
frameCount: totalFrames.length
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (userFiles.length > 0) {
|
if (userFiles.length > 0) {
|
||||||
msg.files = userFiles;
|
msg.files = userFiles;
|
||||||
|
|||||||
Reference in New Issue
Block a user