# Embed a live ECG rhythm in a course

> Put any rhythm or 12-lead condition, running live, into a course page, a learning platform or a site with a few lines of HTML, at a fixed size or the full width.

Source: https://www.ecgsweep.com/docs/embed

Embedding puts a live ECG from ECG Sweep on a page of your own: a course page, a learning platform, a blog or a site. The trace runs in the frame beat by beat, as it does here, and a caption under it links back to the rhythm's page. This page is the reference: what the code does, where to paste it on each platform, what to use where a live frame will not run, and what to do when it does not show.

> **Note:** To get the code, use the builder on [Embed and reuse](https://www.ecgsweep.com/embed): choose the tool, the rhythm or condition, and the size, then copy. On any rhythm in the simulator, **Share › Embed on a website** gives the same code.

## What you can embed

Two tools, and everything in each:

| Tool | What the frame shows | Its natural size |
| --- | --- | --- |
| Simulator | One lead, any of its rhythms, running live with play and pause | 640 × 360 |
| 12-lead | All twelve leads, any of its conditions | 960 × 540 |

Both are 16:9. Every page has a frame at its own address with `/embed` in front: the simulator's [atrial fibrillation](https://www.ecgsweep.com/simulator/atrial-fibrillation) is framed at `/embed/simulator/atrial-fibrillation`, and the 12-lead's right bundle branch block at `/embed/12-lead/right-bundle-branch-block`. Normal sinus rhythm is the tool's own address: `/embed/simulator` or `/embed/12-lead`.

## The code, part by part

The builder gives you a few lines of HTML. Each part has a job:

- **The frame** (`<iframe>`): the live ECG. Its `src` is the embed address above; `loading="lazy"` waits to load it until a reader scrolls near it, so a long course page stays quick.
- **Its title**: the rhythm's name, the tool and ECG Sweep. Screen readers announce it, so keep it.
- **The caption** (`<figcaption>`): "Interactive ECG by ECG Sweep, CC BY-NC-ND 4.0", with the link to the rhythm's page. The link is the credit the licence asks for: keep it, or put your own visible link to the page beside the frame.
- **The size**: a fixed size or the full width, below.

### Fixed size or full width

- **The fixed size** (the builder's **640 × 360** for the simulator, **960 × 540** for the 12-lead) sets the frame to its natural size and lets it shrink on a narrow screen. Choose it where you know the column's width, or the platform asks for a width and height.
- **Full width** fills the width of the column it is in, at 16:9. Choose it for course pages whose width you do not know, and for pages read on phones. For the 12-lead, a column under about 720 px wide makes twelve leads small: link to the page instead, or use the simulator for one lead.

### Markdown

Where a page takes Markdown and not HTML, such as a README or a wiki, the builder's **Markdown instead** gives the rhythm's share card as an image that links to its page. It is a picture, not a live strip: a click opens the rhythm on ECG Sweep.

## Where to paste it

Paste the code where your page accepts HTML, not into the normal text box, which shows the code as words. On each platform:

- **WordPress:** add a **Custom HTML** block and paste the code into it.
- **Moodle:** in the text editor, switch to its HTML view (**Source code** in the newer editor, **HTML** in the older one), paste, and switch back. Some Moodle sites remove frames from what teachers paste: if the frame disappears when you save, ask your administrator to allow embedded content for your course.
- **Canvas:** in a page's editor, open the HTML editor (the `</>` button), paste, and save.
- **Blackboard:** use the content editor's HTML or source view. Some Blackboard sites block frames from other sites: if yours does, link to the page.
- **Google Sites:** choose **Insert › Embed › Embed code**, paste, and drag the box to size.
- **Notion:** type `/embed` and paste the frame's address on its own (the `/embed/...` address, not the HTML). If Notion shows a link card instead of the live frame, that is Notion's choice for the address: the card still opens the rhythm.
- **Any other site:** look for an "embed", "HTML" or "source" option in its editor.

## Where a live frame will not run

Some places show only pictures and links. Each still has a way in:

- **Slides.** PowerPoint, Keynote and Google Slides do not run web pages. Save the strip as a PNG with the simulator's **Download** button and put it on the slide, or link to the rhythm's page and open it live in class.
- **Printed handouts and exam papers.** Use the PNG, with the credit line under it (below).
- **Social feeds.** X, Facebook and LinkedIn do not run frames. Share the page from its **Share** menu: the post shows the rhythm's card.
- **Email.** Mail apps do not run frames either: send the page's link.

## Giving credit

Everything you embed, download or share from ECG Sweep is licensed [CC BY-NC-ND 4.0](https://www.ecgsweep.com/embed#licence): free for teaching and study, with a visible credit, unchanged.

- **On a web page**, the embed's caption is the credit. If you remove it, keep a visible link to the rhythm's page or to ecgsweep.com near the frame.
- **On a slide, a handout or a paper**, put a line under the strip, for example: "ECG: ECG Sweep (ecgsweep.com), CC BY-NC-ND 4.0".
- **For a paid course or a product**, the licence does not cover it: [get in touch](mailto:contact@ecgsweep.com) first.
- **Show it unchanged.** Embed or show the strip as it is; do not redraw or edit the waveforms and pass them on.

## When it does not show

- **The frame is blank, or says the site refused to connect.** Your site blocks frames from other sites. Ask its administrator to allow frames from ecgsweep.com, or link to the page.
- **The code appears as text on the page.** It was pasted into the normal text box: paste it into the HTML or source view instead.
- **The frame disappears when you save.** The platform strips frames from what you paste (common on learning platforms). Ask the administrator to allow embedded content, or link to the page.
- **The caption is gone, or its link does not work.** Some editors remove the caption's link. Add your own visible link to the page beside the frame: it is the credit.
- **The strip is too small to read.** Use the fixed size, or give the 12-lead a wider column; on a phone, the simulator's one lead reads better than twelve.
- **It does not move.** The strip pauses while it is off screen, and can be paused in the frame: press play.

## Good to know

ECG Sweep is an educational simulation, not a diagnostic device, and not for clinical decisions. Embedding needs no account and is free for teaching. For everything else on reusing the strips, see [Embed and reuse](https://www.ecgsweep.com/embed).
