# google-cast

Options for the Google Cast extension that configures the receiver and load request

Adds the [Google Cast extension](../../guides/architecture.md) to the player. It renders nothing — place it anywhere inside the player, and pair it with a [CastButton](./cast-button.md). It follows whatever media the player attaches, a plain `<video>` included. See [Cast to AirPlay and Chromecast](../../guides/casting.md) for the complete setup.

## Import

```bash
pnpm add @videojs/html @videojs/google-cast
```

```ts
import '@videojs/html/extensions/google-cast';
```

Or load it from the [CDN](../../guides/cdn.md):

```html
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.6.0/extensions/google-cast.js"></script>
```

## Anatomy

```html
<google-cast></google-cast>
```

## Options

| Attribute | Property | Description |
| --- | --- | --- |
| `receiver` | `receiver` | Cast receiver application ID. Defaults to Google’s Default Media Receiver (`CC1AD845`), which can’t license DRM content |
| `src` | `src` | Source URL loaded on the receiver. Defaults to the source the browser is playing. Required for YouTube and Vimeo embeds |
| `content-type` | `contentType` | MIME type of the Cast source. When unset, the receiver infers it from the URL |
| `stream-type` | `streamType` | Stream type reported to the receiver. Falls back to the player’s stream type |
| — | `customData` | Custom data sent to the receiver with each load request |

`customData` takes an object, so it’s a property only, with no matching attribute. Set it on the element, typed as the `GoogleCastExtension` class that `@videojs/html/extensions/google-cast` exports.

When the Cast `src` is an HLS playlist, Video.js detects the segment format and sets the receiver’s `hlsSegmentFormat` and `hlsVideoSegmentFormat` load-request fields. The Default Media Receiver plays HLS natively, so no extra receiver setup is needed.

## See also

- [Cast to AirPlay and Chromecast](../../guides/casting.md): Add remote playback to a player
- [CastButton component reference](./cast-button.md)
- [Remote Playback feature reference](../api/feature-remote-playback.md)