feat(webui): render video media attachments
Add signed media URLs to live WebSocket replies and teach the WebUI to classify and render video attachments, so bot-sent videos can play inline in both live chats and session history. Made-with: Cursor
This commit is contained in:
@@ -40,4 +40,28 @@ describe("MessageBubble", () => {
|
||||
fireEvent.click(toggle);
|
||||
expect(screen.queryByText('weather("get")')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders video media as an inline player", () => {
|
||||
const message: UIMessage = {
|
||||
id: "a1",
|
||||
role: "assistant",
|
||||
content: "here is the clip",
|
||||
createdAt: Date.now(),
|
||||
media: [
|
||||
{
|
||||
kind: "video",
|
||||
url: "/api/media/sig/payload",
|
||||
name: "demo.mp4",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const { container } = render(<MessageBubble message={message} />);
|
||||
|
||||
expect(screen.getByText("here is the clip")).toBeInTheDocument();
|
||||
const video = screen.getByLabelText(/video attachment/i);
|
||||
expect(video.tagName).toBe("VIDEO");
|
||||
expect(video).toHaveAttribute("src", "/api/media/sig/payload");
|
||||
expect(container.querySelector("video[controls]")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user