videosphere
    Preparing search index...

    Interface Livestream

    Scheduled livestream document stored in the livestreams collection.

    YouTube key-slot lifecycle: A new livestream starts as a draft with no scheduledStartTime or keySlot. When the user schedules it, the server assigns either the main or temp YouTube stream key from the connected account. If the main key is already in use, scheduling uses temp instead. A background reconciliation job may later promote tempmain when the main slot frees up (keySwapPromotedAt records when that promotion occurred). keySlot and related fields are YouTube-only; Facebook livestreams never use them.

    Facebook arm lifecycle: Facebook has no main/temp stream-key concept. Only one Facebook livestream per user may be "armed" (have a real facebookLiveVideoId) at a time. The first scheduled Facebook livestream creates its LiveVideo immediately; additional queued rows create theirs automatically at the auto-preparation window before start (autoPromoteToMainKey / autoPromoteToMainKeyMinutes, shared with YouTube temp→main promotion timing).

    interface Livestream {
        id: string;
        userId: string;
        status: LivestreamStatus;
        title: string;
        description: string;
        tags: string[];
        visibility: PlatformUploadVisibility;
        targets: ConnectedAccountPlatform[];
        platforms: LivestreamPlatforms;
        scheduledStartTime?: string;
        scheduledStartTimeZone?: string;
        thumbnailR2Key?: string;
        thumbnailContentType?: string;
        thumbnailPreviewUrl?: string;
        youtubeBroadcastId?: string;
        youtubeBoundStreamId?: string;
        keySlot?: LivestreamKeySlot;
        keySwapPromotedAt?: string;
        keySlotStaleAt?: string;
        autoPromoteToMainKey?: boolean;
        autoPromoteToMainKeyMinutes?: number;
        youtubeLifecycleStatus?: string;
        facebookLiveVideoId?: string;
        facebookStreamUrl?: string;
        facebookArmedAt?: string;
        facebookLifecycleStatus?: string;
        $createdAt: string;
        $updatedAt: string;
    }
    Index

    Properties

    id: string
    userId: string
    title: string
    description: string
    tags: string[]

    Platforms this livestream is configured to broadcast to (UI toggles).

    Per-platform-only options (e.g. YouTube categoryId, live comment settings).

    scheduledStartTime?: string

    ISO 8601 scheduled start time; undefined while still a draft.

    scheduledStartTimeZone?: string

    IANA timezone for interpreting scheduledStartTime in the schedule picker (e.g. America/Toronto).

    thumbnailR2Key?: string

    R2 object key for a custom thumbnail image (JPG or PNG), or undefined if none.

    thumbnailContentType?: string

    MIME type of the thumbnail object (for platform upload and preview).

    thumbnailPreviewUrl?: string

    Ephemeral presigned GET URL for the livestream form preview. Not stored in persistent storage.

    youtubeBroadcastId?: string

    YouTube liveBroadcasts resource id after the broadcast is created.

    youtubeBoundStreamId?: string

    YouTube liveStreams resource id bound to this broadcast.

    Which connected-account stream key slot is assigned (main or temp).

    keySwapPromotedAt?: string

    ISO timestamp when a temp key slot was promoted to main during reconciliation.

    keySlotStaleAt?: string

    ISO timestamp when a main-slot livestream never went live and was moved to temp / ended so a queued livestream could take the main key.

    autoPromoteToMainKey?: boolean

    When true on a temp-slot livestream, a background job promotes it to the main key before start. Defaults to enabled for temp-slot rows when unset.

    autoPromoteToMainKeyMinutes?: number

    Minutes before scheduled start to auto-promote temp → main (5–60, step 5; default 30).

    youtubeLifecycleStatus?: string

    Raw YouTube liveBroadcasts.status.lifeCycleStatus value (polled later).

    facebookLiveVideoId?: string

    Facebook LiveVideo object id; created at arm time, not at schedule time.

    facebookStreamUrl?: string

    RTMPS ingest URL returned when the Facebook LiveVideo is created (rtmps://live-api-s.facebook.com:443/rtmp/FB-<id>-0-<token>). Single-use per object; there is no reusable/persistent equivalent. Encrypted at rest in the livestream document JSON.

    facebookArmedAt?: string

    ISO timestamp when the Facebook LiveVideo object was created (arm time).

    facebookLifecycleStatus?: string

    Raw Facebook LiveVideo.status value (UNPUBLISHED, LIVE_NOW, VOD; polled later).

    $createdAt: string

    Persistence system attribute (ISO string).

    $updatedAt: string

    Persistence system attribute (ISO string).