API Reference
Norri exposes a REST API for the web app, client apps, and local integrations. This page covers the playback routes most likely to be useful to client authors.
Authentication
Most API requests require a bearer token.
curl -H "Authorization: Bearer YOUR_TOKEN" \
http://localhost:11423/api/playback/sessions/active
Streaming URLs may use a stream token in the URL because browser video and audio elements cannot attach authorisation headers.
Base path
API routes use the /api prefix.
Playback sessions
| Method | Endpoint | Description |
|---|---|---|
POST | /api/playback/sessions | Create a playback session for a movie or episode. |
GET | /api/playback/sessions/active | List the current user’s active sessions. |
GET | /api/playback/sessions/:sessionId | Get session state, selected tracks, stream metadata, and the optional playback_info object used by the web player. |
POST | /api/playback/sessions/:sessionId/heartbeat | Keep the session alive and update playback position. |
POST | /api/playback/sessions/:sessionId/ping | Keep the session alive without updating resume position or progress history. |
PATCH | /api/playback/sessions/:sessionId/tracks | Change the selected audio or subtitle track. |
POST | /api/playback/sessions/:sessionId/stop | Stop playback with a final position. |
DELETE | /api/playback/sessions/:sessionId | End playback and fall back to the last heartbeat position. |
Use heartbeat while normal playback is progressing. Use ping for liveness-only situations where the session should stay alive but the saved position should not move.
Client capabilities
When creating a playback session, clients send a client_profile object describing what they can play. Accurate capabilities let Norri choose direct play, HLS remux, or transcoding correctly.
HDR-aware clients should report support for:
| Capability | Meaning |
|---|---|
supportsHdr10 | Client can play HDR10 correctly. |
supportsHlg | Client can play HLG correctly. |
supportsDoVi | Client reports Dolby Vision support. Concrete profile and delivery limits still apply. |
hevcMain10 | Optional HEVC Main 10 decoder result, separate from HDR presentation support. |
Norri 0.2.0 accepts the following optional capabilities.
| Capability | Meaning |
|---|---|
hevcMaxFramerate | Optional frame-rate limit from successful HEVC resolution probes. |
dolbyVisionCapabilities | Optional array of successful Dolby Vision codec probes with explicit limits. Send an empty array when no probes succeed. |
Each dolbyVisionCapabilities entry contains codec (dvhe or dvh1), profile, level, maxWidth, maxHeight, and maxFramerate. Report only configurations the client can play at those limits. The web player requires supported, smooth codec probe results; it does not infer Dolby Vision support from an HDR display or generic HEVC support. An empty array reports no support even if supportsDoVi is true. Older clients can omit the array to retain legacy Dolby Vision admission for eligible original files; that fallback does not qualify a new remux.
Original Dolby Vision playback requires a compatible source configuration and matching client capability. Clients that read files themselves can report support for a compatible HDR10 or HLG base. Single-layer sources can play directly, and sources with an enhancement layer can be remuxed without it where the client supports that route. Browser and native HLS delivery still require support for the particular packaging. SDR conversion requires Enable HDR Tone Mapping and a supported source configuration. See HDR Playback.
Recovery after a decoder failure
In Norri 0.2.0, session creation also accepts optional decoder_fallback: true. The web player requests this after an actual decoder failure during direct or copied-video playback, or when the browser rejects converted HEVC video. This requests H.264 SDR conversion and AAC audio when audio is present. Source conversion requirements and the client’s output limits still apply; the flag does not bypass HDR tone-mapping settings or establish that the conversion will succeed.
The web player makes at most one automatic conversion retry per playback attempt. The new request retains the current position, selected tracks, effective quality mode, and existing connection-test result. If direct playback skipped a connection test required by the quality mode, conversion can request that first test. An already-attempted test is not repeated.
Playback diagnostics
These optional diagnostic fields are available in Norri 0.2.0.
Session creation accepts optional client_diagnostics beside client_profile. These observations are retained for support and do not replace routing capabilities. Version 1 uses schema_version: 1, an RFC 3339 captured_at timestamp, browser name/version/OS hints, display media-query observations, and a probes array. At most 32 probe entries are retained; text fields are limited to 128 characters. Send technical probe inputs and results, not raw user agents, URLs, or error messages.
An authenticated session heartbeat can include optional client_playback evidence alongside its normal position_ms and is_paused values:
event | Additional fields |
|---|---|
first_video_frame | evidence_source: request_video_frame_callback or video_playback_quality. |
player_error | error_code and error_category: short technical identifiers, up to 64 characters each. The web player uses recoverable or fatal categories. Optional output_video_codec records a known delivered video codec (hevc or h264). |
Report actual frame evidence rather than treating session creation or a playing event as proof. The web player’s frame-counter fallback requires a new, non-dropped frame. The server retains one frame observation and at most three distinct player errors per session. These reports supplement normal progress and do not establish HDR display output. Administrators can export the retained records through Download diagnostics.
Subtitle delivery
Session responses include delivery_method on each subtitle track so clients know how the track will be delivered if selected.
| Value | Meaning |
|---|---|
external | Sent as an external text subtitle file. |
hls | Sent through the HLS stream. |
embed | Already embedded in a directly playable file. |
burnin | Rendered into the video during transcoding. |
drop | Not delivered for this session. |
This field is informational for clients. Users choose subtitles by track name, language, and type, not by delivery method.
Transcoding settings
Admins can read or update transcoding settings through:
| Method | Endpoint | Description |
|---|---|---|
GET | /api/playback/settings | Read transcoding settings. |
PATCH | /api/playback/settings | Update transcoding settings. |
See Configuration Options for setting names, defaults, and valid values.