> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tday.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Play tday.com links in your product

> For teams building a feed, forum, chat or docs tool - turn a pasted tday.com link into a playing video, with no account or API key.

This page is for teams who build a product where people post links: a community feed, a forum, a
chat, a wiki or a docs tool. When someone posts a tday.com link, you can show the video playing in
place instead of a plain link. It takes no account, no API key and nobody at tday.com: every public
tday.com video can be framed by any site.

[Play tday.com links right in your feed](https://tday.com/e/pbhsp5ye)

There are two ways to do it. Pick one:

| Way | You need | Best when |
| - | - | - |
| [Match the link](#match-the-link) | A regular expression and an iframe | You want the player with no extra request, rendered in the browser |
| [Ask oEmbed](#ask-oembed) | One server-side request per link | You already unfurl links (title, thumbnail) and want the video's name and poster too |

If your product already supports oEmbed discovery, or embeds through Iframely or Embedly, tday.com links
may already work: every tday.com video page names its oEmbed endpoint ([Discovery](#discovery)).

## Match the link

A tday.com video link looks like one of these:

```text theme={null}
https://tday.com/ab2cd3ef            the video's page
https://tday.com/e/ab2cd3ef          the bare player
https://tday.com/ab2cd3ef?c=b4       either one, opening at a chapter
```

The id is always 8 characters from `abcdefghjkmnpqrstuvwxyz23456789` (lowercase letters and digits,
without the look-alikes `0 o 1 l i`). Match it, then frame the player at `https://tday.com/e/<id>`:

```js JavaScript wrap theme={null}
const TDAY_VIDEO = /^\/(?:e\/)?([a-hjkmnp-z2-9]{8})\/?$/;
// One of our own pages also has an 8-letter name. Never frame it.
const NOT_VIDEOS = new Set(["research"]);

function tdayEmbed(link) {
  let url;
  try { url = new URL(link.trim()); } catch { return null; }
  if (url.hostname !== "tday.com" && url.hostname !== "www.tday.com") return null;
  const m = TDAY_VIDEO.exec(url.pathname);
  if (!m || NOT_VIDEOS.has(m[1])) return null;
  const chapter = url.searchParams.get("c");
  const src = `https://tday.com/e/${m[1]}` + (chapter ? `?c=${encodeURIComponent(chapter)}` : "");
  return `<iframe src="${src}" title="tday.com video" style="width:100%;aspect-ratio:16/9;border:0;border-radius:12px" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen loading="lazy"></iframe>`;
}
```

* **Keep `?c=`.** It names a chapter of the video, so a link someone posted at a particular step
  opens at that step.
* **Size by width.** The player is 16:9. Set its width and `aspect-ratio: 16 / 9`, and leave out
  `height`, which would cancel the ratio.
* **Allow fullscreen.** Keep `allow="autoplay; fullscreen; picture-in-picture"` and `allowfullscreen`
  so the player's fullscreen button works.
* **Our other pages are not videos.** Almost none of them fit the pattern, since the id must be
  exactly 8 characters of the alphabet above, at the root or under `/e/`. The one that does is left
  out above. A link that fits but names no video shows "no longer available" in the frame. If you
  would rather never guess, [ask oEmbed](#ask-oembed): it answers only for real videos.

## Ask oEmbed

tday.com answers [oEmbed](https://oembed.com) for every public video. Call it from your server when a
link is posted:

```bash theme={null}
curl "https://tday.com/api/oembed?url=https%3A%2F%2Ftday.com%2Fab2cd3ef&format=json"
```

```json Response wrap theme={null}
{
  "version": "1.0",
  "type": "video",
  "provider_name": "tday.com",
  "provider_url": "https://tday.com",
  "title": "Acme - Invite your team",
  "author_name": "Acme",
  "html": "<iframe src=\"https://tday.com/e/ab2cd3ef\" title=\"Acme - Invite your team\" width=\"1280\" height=\"720\" style=\"border:0\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen loading=\"lazy\"></iframe>",
  "width": 1280,
  "height": 720,
  "thumbnail_url": "https://cdn.tday.com/.../poster.png",
  "thumbnail_width": 1920,
  "thumbnail_height": 1080,
  "cache_age": 3600
}
```

| Parameter | |
| - | - |
| `url` | Required. The video's page or player link, URL-encoded. A `?c=` in it carries into the player. |
| `format` | `json` (the default). Other formats answer `501`. |
| `maxwidth`, `maxheight` | Optional. The player is fitted inside them at 16:9. |

* **Status codes.** `200` with the JSON above; `404` for a link that is not a tday.com video, a
  private video, or one that has been removed. A `404` for a real video link is not cached, since a
  video that is still rendering answers a few minutes later.
* **Caching.** Keep an answer for up to `cache_age` seconds. You do not need to refresh it when the
  video is re-recorded: the player always plays the newest take.
* **Open to everyone.** No key, and CORS allows every origin.

If you only want the poster and title for a link card, use `thumbnail_url` and `title` from the same
answer.

## Discovery

Every tday.com video page carries the standard tags, so a generic unfurler finds the player on its
own:

```html theme={null}
<link rel="alternate" type="application/json+oembed" href="https://tday.com/api/oembed?url=...&format=json">
<meta property="og:video" content="https://tday.com/e/ab2cd3ef">
```

If your product embeds through Iframely or Embedly, it reads these too.

## What the player does

* **Plays the newest take.** A link points at the video, not one version of it. When the team behind
  it records it again, every post that embeds it plays the new take, with no change on your side.
* **Stays inside its frame.** The player is the video alone, edge to edge, with no tday.com page
  around it. Any link in it opens in a new tab.
* **Sets no cookies and loads no analytics.** It runs inside other people's pages, so it counts
  views without tracking the viewer.
* **Says when it cannot play.** A private video shows "This video is private." and a removed one
  shows that it is no longer available, inside the frame, so a stale post never breaks your layout.

## Content Security Policy

If your site sets a Content Security Policy, allow the player in frames:

```text theme={null}
frame-src https://tday.com;
```

With oEmbed thumbnails shown as images, also allow `img-src https://cdn.tday.com`.

## Questions

Write to [support@tday.com](mailto:support@tday.com) if you are adding tday.com links to your product and
want us to test it with you.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.