Image subtitle lookahead prefetch now defaults to 15 seconds and is capped at
30 seconds, allowing more upcoming bitmap subtitle frames to be warmed in cache
before display. This targets small residual subtitle lag while preserving the
bounded prefetch guardrails.
Both authenticated playback and share playback were updated to request the same
15-second lookahead so behaviour stays consistent across player surfaces, and
the technical reference now documents the new default and cap.
Image subtitle rendering now prefetches upcoming subtitle-frame buckets ahead
of the current playback position to reduce visible lag when a new bitmap subtitle
event starts. The shared player overlay keeps rendering behaviour unchanged for
the current frame, while best-effort background requests warm the server frame
cache for near-future timestamps.
Lookahead defaults to 5 seconds and is bounded to 15 seconds maximum, with
0.5-second prefetch steps to keep memory and request volume predictable. The
setting is wired through both authenticated and share playback paths so they
stay in sync with identical behaviour.
This keeps image subtitle memory usage controlled while improving subtitle
responsiveness at event boundaries.
Shared video playback logic now lives in a single browser helper used by both the signed-in app preview and the public share page. This keeps Video.js buffering, VOD UI normalisation, track preference restore/save, and image subtitle overlay behaviour aligned automatically instead of maintaining two separate implementations.
The share backend now exposes the same supporting stream lifecycle pieces the normal player expects: a subtitle-frame endpoint for bitmap subtitle rendering and an explicit session-release endpoint so share sessions are cleaned up on page close instead of waiting for idle expiry.
Users opening a shared video can now access image subtitles the same way they can in the normal player, and future player fixes only need to be made once.
When var_stream_map uses name: entries (e.g. name:video, name:Audio-1-jpn),
ffmpeg substitutes the stream name for %v in segment filenames, producing
files like stream_video_segment_000000.ts instead of stream_0_segment_000000.ts.
The regex stream_\d+_segment was used in three places (hasInitialHlsAssets,
parseSegmentIndexFromAssetPath, and runSegmentPrune) — none of which matched
named-variant filenames, so parseSegmentIndexFromAssetPath always returned null,
scheduleSegmentPrune was never called, and segments accumulated indefinitely
(1041 files / 478 MB for a 21-minute episode) while RAM climbed from 26% to 39%.
Changed all three regexes to stream_.+_segment_ so both numeric and named
variants are matched correctly. The debug snapshot's slowestViewerSegmentIndex
now uses ?? -1 instead of || 0 so a null (never-tracked) value is visible as -1
rather than silently masking as 0.
Two tests updated/added: the existing prune test now writes named-variant segment
files (stream_video and stream_Audio-1) matching what ffmpeg actually produces,
and a new test confirms no pruning occurs while below the retention window.
Adds host/process RAM metrics and stream retention/prune telemetry to the admin debug dashboard so lag can be correlated with memory and segment buildup in real time. Includes minor formatting-only cleanups in touched UI/subtitle files without behavioural change.
Adds copy buttons to each debug dashboard sub-panel so admins can quickly export diagnostics for troubleshooting. Users and storage export as JSON; stream/cache and orphaned output panels export as CSV for easy sharing and analysis.
Adds periodic cleanup of temporary HLS stream output directories whenever no viewers are active, alongside startup cleanup. This prevents stale segment folders from lingering after crashes or interrupted sessions and improves long-run streaming stability and memory/disk hygiene.
Adds an admin-only Debug menu action in the top bar with a live dashboard for signed-in users, root usage, active stream footprint, and subtitle cache usage per video. The payload now includes videos that still have cached data even when nobody is watching. This helps monitor stream cleanup behaviour and detect lingering cache/segment data during sequential playback sessions.