# Embed a YouTube live stream with chat

> Show a YouTube live stream and its live chat side by side in Teachfloor using two iframe embed codes.

Source: https://support.teachfloor.com/articles/youtube-live-stream-chat  
Collection: Integrations  
Last updated: 2026-11-22

Embedding a YouTube live stream with its live chat lets your audience watch and interact without leaving your platform. You need two separate HTML `<iframe>` elements: one for the video and one for the chat.

## Get the video embed code

YouTube generates the standard embed code for the live stream video:

1. Go to your live stream's page on YouTube.
2. Click **Share**.
3. Select **Embed**.

Copy the entire block of code. It looks similar to this:

```html
<iframe width="560" height="315" src="https://www.youtube.com/embed/YOUR_VIDEO_ID" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
```

## Create the chat embed code

Next, create the `<iframe>` for the live chat by hand. It is separate from the video embed code. Use the correct URL format and include your domain for security:

```html
<iframe width="350" height="500" src="https://www.youtube.com/live_chat?v=YOUR_VIDEO_ID&embed_domain=app.teachfloor.com" frameborder="0"></iframe>
```

> **Important:** Replace `YOUR_VIDEO_ID` with the ID of your live stream. You can find it in the video URL, right after `v=`. The `embed_domain` parameter is required for security: set it to `app.teachfloor.com`.

## Combine both codes

Paste both `<iframe>` blocks into the HTML where you want them to appear. Place them side by side or one above the other:

```html
<iframe width="560" height="315" src="https://www.youtube.com/embed/YOUR_VIDEO_ID" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
<iframe width="350" height="500" src="https://www.youtube.com/live_chat?v=YOUR_VIDEO_ID&embed_domain=app.teachfloor.com" frameborder="0"></iframe>
```

To add embed code to a lesson, use the [Embed element](https://support.teachfloor.com/articles/embed-activity).

## Adjust width and height

You can change the `width` and `height` attributes of both `<iframe>` elements to fit your layout. The chat is usually narrower than the video player.
