# place.stream.playback.getLiveSegment

> Published by [did:web:stream.place](https://lexicon.garden/identity/did:web:stream.place)

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:web:stream.place/place.stream.playback.getLiveSegment)
- [Documentation](https://lexicon.garden/lexicon/did:web:stream.place/place.stream.playback.getLiveSegment/docs)
- [Examples](https://lexicon.garden/lexicon/did:web:stream.place/place.stream.playback.getLiveSegment/examples)

## Definitions

### `place.stream.playback.getLiveSegment`

**Type**: `query`

Fetch a single live HLS segment, or a track's init segment, from the in-memory live window. `seg` is `init` for the EXT-X-MAP init segment, otherwise the segment's media-sequence number; a cosmetic `.m4s` suffix is accepted (and ignored) so ffmpeg-based HLS players will fetch it. HTTP Range is honored. Segments are the verbatim signed canonical .m4s, so provenance travels with playback.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `seg` | `string` | Yes | `init` for the track's init segment, or the segment's media-sequence number. A trailing `.m4s` is accepted and ignored. |
| `sid` | `string` | No | Opaque playback session identifier, propagated from the media playlist that referenced this segment. Logged for view-count correlation; not used for access control. |
| `track` | `string` | Yes | Track ID (stringified u32 matching the MUXL container). |
| `streamer` | `string` | Yes | The streamer: a DID or a Bluesky handle (resolved to its DID). |

#### Output

**Encoding**: `video/mp4`

#### Errors

- **StreamNotLive**: No live window for this streamer on this node.
- **SegmentNotFound**: The requested segment has slid out of the window, or never existed.

## Raw Schema

```json
{
  "id": "place.stream.playback.getLiveSegment",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "StreamNotLive",
          "description": "No live window for this streamer on this node."
        },
        {
          "name": "SegmentNotFound",
          "description": "The requested segment has slid out of the window, or never existed."
        }
      ],
      "output": {
        "schema": null,
        "encoding": "video/mp4"
      },
      "parameters": {
        "type": "params",
        "required": [
          "streamer",
          "track",
          "seg"
        ],
        "properties": {
          "seg": {
            "type": "string",
            "description": "`init` for the track's init segment, or the segment's media-sequence number. A trailing `.m4s` is accepted and ignored."
          },
          "sid": {
            "type": "string",
            "description": "Opaque playback session identifier, propagated from the media playlist that referenced this segment. Logged for view-count correlation; not used for access control."
          },
          "track": {
            "type": "string",
            "description": "Track ID (stringified u32 matching the MUXL container)."
          },
          "streamer": {
            "type": "string",
            "description": "The streamer: a DID or a Bluesky handle (resolved to its DID)."
          }
        }
      },
      "description": "Fetch a single live HLS segment, or a track's init segment, from the in-memory live window. `seg` is `init` for the EXT-X-MAP init segment, otherwise the segment's media-sequence number; a cosmetic `.m4s` suffix is accepted (and ignored) so ffmpeg-based HLS players will fetch it. HTTP Range is honored. Segments are the verbatim signed canonical .m4s, so provenance travels with playback."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
