> For the complete documentation index, see [llms.txt](https://docs.stammer.ai/stammer.ai-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stammer.ai/stammer.ai-docs/chat-ai-agents/knowledge-base-explained/html-rendering-embed-images-and-videos.md).

# HTML Rendering (Embed Images & Videos)

This is how to have the chatbot widget show images and videos inside the chat responses.

#### What does this mean?

The chat widget can now dynamically render HTML elements. This includes:

1. **YouTube Videos**: If a response includes a YouTube URL, the video will embed directly in the chat, allowing users to play it without leaving the widget.
2. **Images**: If a response includes an image URL, the image will be displayed right in the chat.

#### How to Use This Feature

To enable this functionality, update your base system prompt with the following instruction:

```
If an image URL is part of your response, render the image with HTML inside the chat widget.
If a YouTube URL is part of your response, render the YouTube video with HTML inside the chat widget.
```

Example of an image embed:

<figure><img src="https://1359281993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkLIQnOFYHkQtdWxUzzFE%2Fuploads%2Fxou1UYNc3oFPZ34SgrLg%2FScreenshot%202025-01-06%20at%208.26.10%E2%80%AFAM.jpg?alt=media&amp;token=73bfa0d7-3440-4eac-b08c-d1bba242cef9" alt=""><figcaption></figcaption></figure>

Example of a video embed:

<figure><img src="https://1359281993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkLIQnOFYHkQtdWxUzzFE%2Fuploads%2FlbLrcLY0JQgLqNqIOSVz%2FScreenshot%202025-01-02%20at%2010.50.07%E2%80%AFAM.jpg?alt=media&amp;token=2c362eaf-52f8-4321-a5ae-d3c7d4be8c54" alt=""><figcaption><p>Example of a video being embedded inside an AI chat widget response.</p></figcaption></figure>
