> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fastpix.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fastpix.com/docs/_mcp/server.

# Optimize live streaming

> Learn best practices for live video streaming in the FastPix Flutter Player.

Learn best practices for live video streaming in the FastPix Flutter Player.

When streaming live video, use an HLS data source with `streamType: StreamType.live`. For the best real-time experience, disable caching so viewers stay as close to the live edge as possible.

## Disable caching for live streams

Caching is useful for on-demand playback, but for live events it introduces unnecessary delay. Always set `cacheEnabled: false`:

```dart
final liveDataSource = FastPixPlayerDataSource.hls(
  playbackId: 'your-playback-id-here',
  streamType: StreamType.live,
  cacheEnabled: false,
  customDomain: "custom-domain",
);
```

## Live streaming checklist

* Set `streamType` explicitly to `StreamType.live`.
* Set `cacheEnabled: false` to minimize latency.
* Use a stable network connection for the best viewer experience.
* If using a custom domain, pass it in the `customDomain` parameter.
* For private live streams, include a valid JWT `token`.