# MuxData

Options for the Mux Data extension that monitors playback quality

Adds the [Mux Data](https://data.mux.com/?utm_source=videojs&utm_campaign=vjs10&utm_content=docs-content) [extension](https://videojs.org/docs/framework/react/guides/architecture) to the player. It renders nothing — place it anywhere inside the player, and it follows whatever media the player attaches. See [Mux Data](https://videojs.org/docs/framework/react/guides/mux-data) for how monitoring works.

## Import

```bash
pnpm add @videojs/react @videojs/mux-data
```

```tsx
import { MuxData } from '@videojs/react/extensions/mux-data';
```

## Anatomy

```tsx
<MuxData />
```

## Options

| Prop | Type | Description |
| --- | --- | --- |
| `envKey` | `string` | Mux Data environment key the beacons are sent to. Optional for Mux-hosted playback |
| `metadata` | `object` | Mux Data metadata for the view |
| `playerSoftwareName` | `string` | Player name reported to Mux Data. Defaults to `videojs-react-<engine>`; see [Player software name](#player-software-name) |
| `playerSoftwareVersion` | `string` | Player version reported to Mux Data. Defaults to the Video.js version |
| `playerInitTime` | `number` | Epoch milliseconds the player was initialized. Defaults to when the player was created |
| `beaconCollectionDomain` | `string` | Custom domain the beacons are sent to |
| `disableCookies` | `boolean` | Stops the SDK from setting cookies |
| `debug` | `boolean` | Turns on SDK debug logging |
| `MuxDataSdk` | `object` | SDK used for monitoring. Set it to `undefined` to switch monitoring off |

Views also report the extension itself as the Mux plugin, so they can be told apart from other Video.js integrations such as `videojs-mux`.

## Player software name

When no player software name is set, views report `videojs-<framework>-<engine>`, where the framework is `html` or `react` and the engine is the one playing the current source:

| Engine | Played by |
| --- | --- |
| `hlsjs` | hls.js |
| `spf-hls-video` | The SPF video engine |
| `spf-hls-video-mpeg-ts` | The SPF video engine with MPEG-TS support |
| `spf-hls-audio` | The audio-only SPF engine |
| `spf-hls-audio-mpeg-ts` | The audio-only SPF engine with MPEG-TS support |
| `spf-hls-background-video` | The SPF background video engine |
| `spf-hls-background-video-mpeg-ts` | The SPF background video engine with MPEG-TS support |
| `shaka` | Shaka Player |
| `dashjs` | dash.js |
| `browser` | The browser itself, like native HLS in Safari or an MP4 file |

The framework is always one word, so everything after the second hyphen is the engine. The name updates on the current view when a source change switches engines. Media that doesn’t declare an engine name leaves it out, as in `videojs-html`. A player software name you set always takes precedence.

The player software version defaults to the Video.js version, and the Mux plugin is reported as `@videojs/mux-data` at the same version.

Changing `MuxDataSdk`, `beaconCollectionDomain`, `debug`, or `disableCookies` restarts monitoring, which ends the current view and starts a new one. The rest update the view in place.

## See also

- [Mux Data](https://videojs.org/docs/framework/react/guides/mux-data): How monitoring works
- [Mux video reference](https://videojs.org/docs/framework/react/reference/components/mux-video)
- [Mux audio reference](https://videojs.org/docs/framework/react/reference/components/mux-audio)

---

React documentation: https://videojs.org/docs/framework/react/llms.txt
All documentation: https://videojs.org/llms.txt
