> For the complete documentation index, see [llms.txt](https://devmosaic.gitbook.io/devmosaic/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devmosaic.gitbook.io/devmosaic/resources/devmosaic-dm-chat/proximity-popups-and-media.md).

# Proximity Popups And Media

Use dm-chat proximity messages, above-head popups, direct GIFs, audio, and YouTube media cards.

Dm Chat uses two related display systems: messages in the chat feed and NUI popups positioned above a player's head.

## Proximity behavior

| Feature    | Chat-feed range       | Above-head popup          |
| ---------- | --------------------- | ------------------------- |
| `/ooc`     | `Config.OOCDistanc`   | None                      |
| `/me`      | `Config.MeDoeDistanc` | 25 units for five seconds |
| `/do`      | `Config.MeDoeDistanc` | 25 units for five seconds |
| Emoji menu | None                  | 25 units for five seconds |
| `/gif`     | None                  | 25 units for five seconds |

`/me` and `/do` therefore can have different feed and popup audiences. For example, with `Config.MeDoeDistanc = 15.0`, a player 20 units away can see the above-head popup but does not receive the matching feed entry.

Popups are hidden when the speaker is off-screen, outside 25 units, or no longer streamed to the local client. Their screen position is continuously updated while visible.

## Emoji popups

Press `T`, select the smile button, and choose an emoji. The chat closes and the emoji appears above the player. Change the available choices in `Config.Emojis`; see [UI Theme and Emojis](/devmosaic/resources/devmosaic-dm-chat/ui-theme-and-emojis.md).

## GIF popups

Use a public direct URL whose path ends in `.gif`:

```
/gif https://cdn.example.com/reactions/wave.gif
```

The URL must be reachable without a login, cookies, or a temporary browser session. A normal webpage containing a GIF is not a direct GIF URL.

{% hint style="warning" %}
The server forwards the first command argument as the URL. Do not use a URL containing unescaped spaces.
{% endhint %}

## Music cards

`/music` accepts a full HTTP or HTTPS URL:

```
/music https://cdn.example.com/audio/theme.mp3
/music https://youtu.be/VIDEO_ID
```

Direct audio uses the browser audio player. YouTube links use the YouTube iframe player. The card provides play or pause, stop, and volume controls.

Only the player who runs `/music` receives the card and audio. Starting new media replaces the current active media card.

## Video cards

`/video` only accepts full `youtube.com` or `youtu.be` HTTP(S) links:

```
/video https://www.youtube.com/watch?v=VIDEO_ID
```

The video uses a `youtube-nocookie.com` embed and is only sent to the player who ran the command. Use the card's stop button to close it.

## Remote-media requirements

For reliable playback, the remote host should:

* Be publicly reachable over HTTPS
* Return the actual GIF or audio content rather than an HTML download page
* Permit browser playback and cross-origin requests
* Avoid expiring session links
* Allow YouTube embedding when a YouTube URL is used

Private, age-restricted, region-blocked, or embedding-disabled YouTube videos can be rejected by the embedded player.
