Skip to content

Latest commit

 

History

History
72 lines (45 loc) · 2.26 KB

File metadata and controls

72 lines (45 loc) · 2.26 KB

API: captions

Where you are: docs → reference → api → captions Read this first: api.md See also: subsystems/captions.md · asr.md · api/asr.md

TL;DR Three endpoints control closed captioning: set mode (off/passthrough/author), feed author-mode text, and read current state. ASR-driven captions flow through a separate backend (see api/asr.md); these endpoints are for human-authored captions and pass-through from source SEI.

Endpoints

POST /api/captions/mode

Purpose: set the caption operating mode. Auth: required. Handler: control/api_captions.go(*API).handleCaptionMode.

Request body (control.captionModeRequest): { "mode": "off" | "passthrough" | "author" }.

  • off — strip all captions from program output.
  • passthrough — forward captions embedded in the selected source (SEI or VANC).
  • author — operator types captions; the caption manager injects them into the program SEI.

Response 200: caption.State.

Errors: 400 (invalid mode), 501 (caption manager not configured).

Related: subsystems/captions.md


POST /api/captions/text

Purpose: ingest a text fragment, trigger a newline, or clear the display buffer. Only valid in author mode. Auth: required. Handler: (*API).handleCaptionText.

Request body (control.captionTextRequest):

{ "text": "Welcome to the show!" }

or

{ "newline": true }

or

{ "clear": true }

Response 200: caption.State.

Errors: 400 (not in author mode, no action specified), 501.


GET /api/captions/state

Purpose: return the current caption state (mode, author buffer, per-source caption availability flags). Handler: (*API).handleCaptionState.

Response 200: caption.State / internal.CaptionState.

Related docs