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

# Handle stream disconnects

Live streaming interruptions can occur due to network issues or errors in streaming software, causing streams to disconnect unexpectedly. FastPix provides built-in mechanisms to handle these disconnects, ensuring a seamless experience for both broadcasters and viewers.

This guide covers:

* **Reconnect Window**: How FastPix manages temporary network disruptions.
* **Webhook Events**: How to track stream status and automate responses.

\


## Reconnect window

The Reconnect Window determines how long FastPix waits before considering a disconnected live stream as ended. If the network connection is restored within this time frame, the stream resumes seamlessly. Otherwise, it transitions to an idle state, and a media asset is created for the concluded stream.

\


### How it works

1. **Live stream starts**: When you start a live stream and connect it to an encoder like OBS, FastPix sends the [`video.live_stream.connected`](/webhooks/live-events#videolive_streamconnected) event.

\


2. **Media transmission begins**: After the encoder starts sending media to FastPix’s ingest server, the following webhook events are triggered:
   * [`video.live_stream.active`](/webhooks/live-events#videolive_streamactive) - indicating the stream is now live.
   * [`video.live_stream.recording`](/webhooks/live-events#videolive_streamrecording) - Recording begins if enabled.

\


3. **Network disruption**: If the connection drops, FastPix detects the issue and sends the [`video.live_stream.disconnected`](/webhooks/live-events#videolive_streamdisconnected) event.

\


4. **Reconnect window initiates**:
   * By default, FastPix waits **60 seconds** before declaring the stream as over.
   * If the connection is restored **within** this period, the stream resumes normally.
   * If the connection is **not** restored within this period, the stream transitions to an **idle state**, and FastPix sends the following events:
     * [`video.live_stream.idle`](/webhooks/live-events#videolive_streamidle) - The stream is no longer active.
     * [`video.media.created`](/webhooks/media-events#videomediacreated) – An on-demand media asset is created for the concluded stream.

\


Here is a webhook event example when network disruption happens:

**`Event example`**

```json Event example
{
  "type": "video.live_stream.created",
  "object": {
    "type": "live",
    "id": "84132a34dfa677eea4b658e09fa07ce2"
  },
  "id": "d6bb41d5-7e51-4bfa-840d-4e343c062109",
  "workspace": {
    "name": "Demo",
    "id": "7f3d4994-ccab-4c83-90af-3e009b4d1541"
  },
  "data": {
    "streamId": "84132a34dfa677eea4b658e09fa07ce2",
    "streamKey": "bf8f433b25d8b6c2da6db70a069ab5cbk84132a34dfa677eea4b658e09fa07ce2",
    "srtSecret": "6a6ef7b539a4a2ace01a7fb81c377beak84132a34dfa677eea4b658e09fa07ce2",
    "trial": false,
    "status": "idle",
    "maxResolution": "1080p",
    "maxDuration": 28800,
    "createdAt": "2025-11-21T09:06:42.496286Z",
    "reconnectWindow": 60,
    "enableRecording": true,
    "enableDvrMode": false,
    "mediaPolicy": "public",
    "metadata": {
      "livestream_name": "fastpix_livestream"
    },
    "lowLatency": false,
    "closedCaptions": false,
    "playbackIds": [
      {
        "id": "cc209362-2d2d-4ffa-85a0-6b83b205ce3b",
        "accessPolicy": "public",
        "accessRestrictions": {
          "domains": {
            "defaultPolicy": "allow",
            "allow": [],
            "deny": []
          },
          "userAgents": {
            "defaultPolicy": "allow",
            "allow": [],
            "deny": []
          }
        }
      }
    ],
    "srtPlaybackResponse": {
      "srtPlaybackStreamId": "play84132a34dfa677eea4b658e09fa07ce2",
      "srtPlaybackSecret": "e57b18e7c799e2ab0b3fff1650573777k84132a34dfa677eea4b658e09fa07ce2"
    }
  },
  "createdAt": "2025-11-21T09:06:45.698708245Z",
  "attempts": []
}
```

\


### Customizing the reconnect window

You can modify the `reconnectWindow` duration to adjust how long FastPix must wait before marking a stream as ended. Setting a higher value allows more time for recovery from temporary network fluctuations, while a lower value ensures quicker termination if the connection is unlikely to be restored.

\


**`POST request`**

```shell POST request
curl -X POST https://api.fastpix.com/v1/live/streams \
  --user "ACCESS_TOKEN_ID:SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{
    "playbackSettings": {
      "accessPolicy": "public"
    },
    "inputMediaSettings": {
      "maxResolution": "1080p",
      "reconnectWindow": 60,
      "mediaPolicy": "public",
      "metadata": {
        "livestream_name": "fastpix_livestream"
      }
    }
  }' 
```

\


> **NOTE**
>
> If `reconnectWindow` is not specified during the API request, it defaults to 60 seconds.
>
> The maximum allowed time for `reconnectWindow` is 1,800 seconds (30 minutes).