> 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.

# Play live and on-demand streams

> Learn how to configure the FastPix iOS Player for live and on-demand video playback.

Learn how to configure the FastPix iOS Player for live and on-demand video playback.

The `streamType` parameter controls how the FastPix iOS Player handles media. Set it based on the type of content you're streaming.

## Supported stream types

The FastPix iOS Player supports two stream types:

* **`on-demand`**: For pre-recorded, non-live content. This is the default.
* **`live`**: For real-time streaming content.

## Play on-demand videos

To play an on-demand video, set the `streamType` to `"on-demand"` in `PlaybackOptions`. If you don't specify a stream type, the player defaults to on-demand.

```swift
// Play an on-demand video (explicit stream type)
playerViewController.prepare(
    playbackID: playbackID,
    playbackOptions: PlaybackOptions(streamType: "on-demand")
)
```

> **Note:** If you omit the `streamType`, the player treats the content as on-demand by default.

## Play live streams

To play a live stream, set the `streamType` to `"live"` and provide the playback ID for the live stream.

```swift
// Play a live stream
playerViewController.prepare(
    playbackID: playbackID,
    playbackOptions: PlaybackOptions(streamType: "live")
)
```

## What's next

* [Secure video playback](/docs/ios-player/secure-video-playback) to protect streams with token-based authentication.
* [Set playback resolution](/docs/ios-player/set-playback-resolution) to control video quality.