# place.stream.livestream

> Record announcing a livestream is happening

- Kind: record
- Record key: tid
- Authority: stream.place
- Lexicon: 1
- Published by [stream.place](https://lexicon.garden/identity/did:plc:rbvrr34edl5ddpuwcubjiost), not the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:rbvrr34edl5ddpuwcubjiost/place.stream.livestream)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:rbvrr34edl5ddpuwcubjiost/place.stream.livestream/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:rbvrr34edl5ddpuwcubjiost/place.stream.livestream/analytics)

## Record (`place.stream.livestream`)

Type: record · key tid

### Properties

- `activity` (union): The game or activity being streamed.
  - One of: `place.stream.defs#activityGame`, `place.stream.defs#activityLabel`
- `agent` (string): The source of the livestream, if available, in a User Agent format: `<product> / <product-version> <comment>` e.g. Streamplace/0.7.5 iOS
- `canonicalUrl` (string · uri): The primary URL where this livestream can be viewed, if available.
- `createdAt` (string · datetime, required): Client-declared timestamp when this livestream started.
- `endedAt` (string · datetime): Client-declared timestamp when this livestream ended. Ended livestreams are not supposed to start up again.
- `idleTimeoutSeconds` (integer): Time in seconds after which this livestream should be automatically ended if idle. Zero means no timeout.
- `lastSeenAt` (string · datetime): Client-declared timestamp when this livestream was last seen by the Streamplace station.
- `notificationSettings` (ref)
  - Reference: `place.stream.livestream#notificationSettings`
- `post` (ref): The post that announced this livestream.
  - Reference: `com.atproto.repo.strongRef`
- `tags` (array): Freeform tags for this stream. Each tag must be alphanumeric (a-z, A-Z, 0-9) plus colon. Tags with colons indicate a specific tag group (e.g. 'lang:en' indicates the stream's primary language).
  - Constraints: maxLength: 10
  - `items` (string)
    - Constraints: maxLength: 640, maxGraphemes: 64
- `thumb` (blob)
  - Constraints: maxSize: 1000000, accept: image/*
- `title` (string, required): The title of the livestream, as it will be announced to followers.
  - Constraints: maxLength: 1400, maxGraphemes: 140
- `url` (string · uri): The URL where this stream can be found. This is primarily a hint for other Streamplace nodes to locate and replicate the stream.

## #livestreamView (`place.stream.livestream#livestreamView`)

Type: object

### Properties

- `author` (ref, required)
  - Reference: `app.bsky.actor.defs#profileViewBasic`
- `cid` (string · cid, required)
- `indexedAt` (string · datetime, required)
- `record` (unknown, required)
- `uri` (string · at-uri, required)
- `viewerCount` (ref): The number of viewers watching this livestream. Use when you can't reasonably use #viewerCount directly.
  - Reference: `#viewerCount`

## #notificationSettings (`place.stream.livestream#notificationSettings`)

Type: object

### Properties

- `pushNotification` (boolean): Whether this livestream should trigger a push notification to followers.

## #streamplaceAnything (`place.stream.livestream#streamplaceAnything`)

Type: object

### Properties

- `livestream` (union, required)
  - One of: `#livestreamView`, `#viewerCount`, `#teleportArrival`, `#teleportCanceled`, `place.stream.defs#blockView`, `place.stream.defs#renditions`, `place.stream.defs#rendition`, `place.stream.chat.defs#messageView`, `place.stream.chat.defs#pinnedRecordView`

## #teleportArrival (`place.stream.livestream#teleportArrival`)

Type: object

### Properties

- `chatProfile` (ref): The chat profile of the source streamer
  - Reference: `place.stream.chat.profile`
- `source` (ref, required): The streamer who is teleporting their viewers here
  - Reference: `app.bsky.actor.defs#profileViewBasic`
- `startsAt` (string · datetime, required): When this teleport started
- `teleportUri` (string · at-uri, required): The URI of the teleport record
- `viewerCount` (integer, required): How many viewers are arriving from this teleport

## #teleportCanceled (`place.stream.livestream#teleportCanceled`)

Type: object

### Properties

- `reason` (string, required): Why this teleport was canceled
  - Constraints: enum: deleted | denied | expired
- `teleportUri` (string · at-uri, required): The URI of the teleport record that was canceled

## #viewerCount (`place.stream.livestream#viewerCount`)

Type: object

### Properties

- `count` (integer, required): Viewers watching right now.
- `presence` (integer): Current channel WebSocket connections on this node, including while offline. Counts connections, not unique people, separately from playback viewers.
  - Constraints: minimum: 0
- `total` (integer): Running number of playback sessions this livestream has had (cumulative, session-based; the X-style 'views' beside the concurrent count).

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "livestreamView": {
      "properties": {
        "author": {
          "ref": "app.bsky.actor.defs#profileViewBasic",
          "type": "ref"
        },
        "cid": {
          "format": "cid",
          "type": "string"
        },
        "indexedAt": {
          "format": "datetime",
          "type": "string"
        },
        "record": {
          "type": "unknown"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        },
        "viewerCount": {
          "description": "The number of viewers watching this livestream. Use when you can't reasonably use #viewerCount directly.",
          "ref": "#viewerCount",
          "type": "ref"
        }
      },
      "required": [
        "uri",
        "cid",
        "author",
        "record",
        "indexedAt"
      ],
      "type": "object"
    },
    "main": {
      "description": "Record announcing a livestream is happening",
      "key": "tid",
      "record": {
        "properties": {
          "activity": {
            "description": "The game or activity being streamed.",
            "refs": [
              "place.stream.defs#activityGame",
              "place.stream.defs#activityLabel"
            ],
            "type": "union"
          },
          "agent": {
            "description": "The source of the livestream, if available, in a User Agent format: `<product> / <product-version> <comment>` e.g. Streamplace/0.7.5 iOS",
            "type": "string"
          },
          "canonicalUrl": {
            "description": "The primary URL where this livestream can be viewed, if available.",
            "format": "uri",
            "type": "string"
          },
          "createdAt": {
            "description": "Client-declared timestamp when this livestream started.",
            "format": "datetime",
            "type": "string"
          },
          "endedAt": {
            "description": "Client-declared timestamp when this livestream ended. Ended livestreams are not supposed to start up again.",
            "format": "datetime",
            "type": "string"
          },
          "idleTimeoutSeconds": {
            "description": "Time in seconds after which this livestream should be automatically ended if idle. Zero means no timeout.",
            "type": "integer"
          },
          "lastSeenAt": {
            "description": "Client-declared timestamp when this livestream was last seen by the Streamplace station.",
            "format": "datetime",
            "type": "string"
          },
          "notificationSettings": {
            "ref": "place.stream.livestream#notificationSettings",
            "type": "ref"
          },
          "post": {
            "description": "The post that announced this livestream.",
            "ref": "com.atproto.repo.strongRef",
            "type": "ref"
          },
          "tags": {
            "description": "Freeform tags for this stream. Each tag must be alphanumeric (a-z, A-Z, 0-9) plus colon. Tags with colons indicate a specific tag group (e.g. 'lang:en' indicates the stream's primary language).",
            "items": {
              "maxGraphemes": 64,
              "maxLength": 640,
              "type": "string"
            },
            "maxLength": 10,
            "type": "array"
          },
          "thumb": {
            "accept": [
              "image/*"
            ],
            "maxSize": 1000000,
            "type": "blob"
          },
          "title": {
            "description": "The title of the livestream, as it will be announced to followers.",
            "maxGraphemes": 140,
            "maxLength": 1400,
            "type": "string"
          },
          "url": {
            "description": "The URL where this stream can be found. This is primarily a hint for other Streamplace nodes to locate and replicate the stream.",
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "title",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "notificationSettings": {
      "properties": {
        "pushNotification": {
          "description": "Whether this livestream should trigger a push notification to followers.",
          "type": "boolean"
        }
      },
      "required": [],
      "type": "object"
    },
    "streamplaceAnything": {
      "properties": {
        "livestream": {
          "refs": [
            "#livestreamView",
            "#viewerCount",
            "#teleportArrival",
            "#teleportCanceled",
            "place.stream.defs#blockView",
            "place.stream.defs#renditions",
            "place.stream.defs#rendition",
            "place.stream.chat.defs#messageView",
            "place.stream.chat.defs#pinnedRecordView"
          ],
          "type": "union"
        }
      },
      "required": [
        "livestream"
      ],
      "type": "object"
    },
    "teleportArrival": {
      "properties": {
        "chatProfile": {
          "description": "The chat profile of the source streamer",
          "ref": "place.stream.chat.profile",
          "type": "ref"
        },
        "source": {
          "description": "The streamer who is teleporting their viewers here",
          "ref": "app.bsky.actor.defs#profileViewBasic",
          "type": "ref"
        },
        "startsAt": {
          "description": "When this teleport started",
          "format": "datetime",
          "type": "string"
        },
        "teleportUri": {
          "description": "The URI of the teleport record",
          "format": "at-uri",
          "type": "string"
        },
        "viewerCount": {
          "description": "How many viewers are arriving from this teleport",
          "type": "integer"
        }
      },
      "required": [
        "teleportUri",
        "source",
        "viewerCount",
        "startsAt"
      ],
      "type": "object"
    },
    "teleportCanceled": {
      "properties": {
        "reason": {
          "description": "Why this teleport was canceled",
          "enum": [
            "deleted",
            "denied",
            "expired"
          ],
          "type": "string"
        },
        "teleportUri": {
          "description": "The URI of the teleport record that was canceled",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "teleportUri",
        "reason"
      ],
      "type": "object"
    },
    "viewerCount": {
      "properties": {
        "count": {
          "description": "Viewers watching right now.",
          "type": "integer"
        },
        "presence": {
          "description": "Current channel WebSocket connections on this node, including while offline. Counts connections, not unique people, separately from playback viewers.",
          "minimum": 0,
          "type": "integer"
        },
        "total": {
          "description": "Running number of playback sessions this livestream has had (cumulative, session-based; the X-style 'views' beside the concurrent count).",
          "type": "integer"
        }
      },
      "required": [
        "count"
      ],
      "type": "object"
    }
  },
  "id": "place.stream.livestream",
  "lexicon": 1
}
```
