BlueGit

timfa filemanager

Increase image subtitle lookahead window

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.

timfa Tim Falken · pushed by timfa

Authored 2026-05-22 · 5 months ago

Hash
235f6d3a512365336821b69b06e9d2ef932a5da3
Parent
011867c6
4 files changed +5 −5
.github/technical-reference.md +1 −1
@@ -160,7 +160,7 @@
160 160 ## public/shared-video-player.js
161 161 - applyDefaultTextTrackPrefs() - Writes the default Video.js caption override settings (transparent background, uniform edge style) so all streamed players start from the same text-track baseline.
162 162 - bindTrackPrefs(player, prefs, savePrefs) - Restores subtitle/audio track selections by track name and persists later track changes; shared by the authenticated player and the share page so both resolve track matches the same way.
163 - bindImageSubtitleOverlay(player, videojs, prefs, session, opts) - Adds the shared IM button/menu/overlay for bitmap subtitle tracks, restores saved image-subtitle selections, fetches rendered frames through a caller-supplied request builder, prefetches lookahead subtitle frames (default 5 seconds, bounded to 15 seconds max) to reduce event-boundary lag, and disables the track after the first hard failure.
163 - bindImageSubtitleOverlay(player, videojs, prefs, session, opts) - Adds the shared IM button/menu/overlay for bitmap subtitle tracks, restores saved image-subtitle selections, fetches rendered frames through a caller-supplied request builder, prefetches lookahead subtitle frames (default 15 seconds, bounded to 30 seconds max) to reduce event-boundary lag, and disables the track after the first hard failure.
164 164 - configureVideoJsBuffering(videojs, opts) - Applies the long forward-buffer settings used for file playback when VHS exposes those knobs.
165 165 - ensureVideoPlaybackUi(player, durationSeconds) - Forces file streams into VOD UI mode, normalises the reported duration, stops live-tracker state, and hides the live badge when present.
166 166
@@ -160,7 +160,7 @@
160## public/shared-video-player.js
160## public/shared-video-player.js
161- applyDefaultTextTrackPrefs() - Writes the default Video.js caption override settings (transparent background, uniform edge style) so all streamed players start from the same text-track baseline.
161- applyDefaultTextTrackPrefs() - Writes the default Video.js caption override settings (transparent background, uniform edge style) so all streamed players start from the same text-track baseline.
162- bindTrackPrefs(player, prefs, savePrefs) - Restores subtitle/audio track selections by track name and persists later track changes; shared by the authenticated player and the share page so both resolve track matches the same way.
162- bindTrackPrefs(player, prefs, savePrefs) - Restores subtitle/audio track selections by track name and persists later track changes; shared by the authenticated player and the share page so both resolve track matches the same way.
163- bindImageSubtitleOverlay(player, videojs, prefs, session, opts) - Adds the shared IM button/menu/overlay for bitmap subtitle tracks, restores saved image-subtitle selections, fetches rendered frames through a caller-supplied request builder, prefetches lookahead subtitle frames (default 5 seconds, bounded to 15 seconds max) to reduce event-boundary lag, and disables the track after the first hard failure.
163- bindImageSubtitleOverlay(player, videojs, prefs, session, opts) - Adds the shared IM button/menu/overlay for bitmap subtitle tracks, restores saved image-subtitle selections, fetches rendered frames through a caller-supplied request builder, prefetches lookahead subtitle frames (default 15 seconds, bounded to 30 seconds max) to reduce event-boundary lag, and disables the track after the first hard failure.
164- configureVideoJsBuffering(videojs, opts) - Applies the long forward-buffer settings used for file playback when VHS exposes those knobs.
164- configureVideoJsBuffering(videojs, opts) - Applies the long forward-buffer settings used for file playback when VHS exposes those knobs.
165- ensureVideoPlaybackUi(player, durationSeconds) - Forces file streams into VOD UI mode, normalises the reported duration, stops live-tracker state, and hides the live badge when present.
165- ensureVideoPlaybackUi(player, durationSeconds) - Forces file streams into VOD UI mode, normalises the reported duration, stops live-tracker state, and hides the live badge when present.
166
166
public/app.js +1 −1
@@ -108,7 +108,7 @@ const FOLDER_GROUP_OPTIONS = [
108 108 ];
109 109 const VIDEO_FORWARD_BUFFER_SECONDS = 60 * 60;
110 110 const VIDEO_FORWARD_BUFFER_OVERRIDE_ENABLED = false;
111 const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS = 5;
111 const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS = 15;
112 112 let videoJsLoaderPromise = null;
113 113 let threePreviewModulesPromise = null;
114 114
@@ -108,7 +108,7 @@ const FOLDER_GROUP_OPTIONS = [
108];
108];
109const VIDEO_FORWARD_BUFFER_SECONDS = 60 * 60;
109const VIDEO_FORWARD_BUFFER_SECONDS = 60 * 60;
110const VIDEO_FORWARD_BUFFER_OVERRIDE_ENABLED = false;
110const VIDEO_FORWARD_BUFFER_OVERRIDE_ENABLED = false;
111const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS = 5;
111const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS = 15;
112let videoJsLoaderPromise = null;
112let videoJsLoaderPromise = null;
113let threePreviewModulesPromise = null;
113let threePreviewModulesPromise = null;
114
114
public/share.html +1 −1
@@ -249,7 +249,7 @@
249 249
250 250 const token = location.pathname.split('/').pop();
251 251 const VIDEO_FORWARD_BUFFER_SECONDS = 60 * 60;
252 const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS = 5;
252 const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS = 15;
253 253 const SHARE_VIDEO_PREFS_KEY = 'filemanager.share-video-prefs.v1';
254 254 let expiresAt = null;
255 255 let timerInterval = null;
@@ -249,7 +249,7 @@
249
249
250 const token = location.pathname.split('/').pop();
250 const token = location.pathname.split('/').pop();
251 const VIDEO_FORWARD_BUFFER_SECONDS = 60 * 60;
251 const VIDEO_FORWARD_BUFFER_SECONDS = 60 * 60;
252 const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS = 5;
252 const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS = 15;
253 const SHARE_VIDEO_PREFS_KEY = 'filemanager.share-video-prefs.v1';
253 const SHARE_VIDEO_PREFS_KEY = 'filemanager.share-video-prefs.v1';
254 let expiresAt = null;
254 let expiresAt = null;
255 let timerInterval = null;
255 let timerInterval = null;
public/shared-video-player.js +2 −2
@@ -7,8 +7,8 @@
7 7 backgroundOpacity: '0',
8 8 edgeStyle: 'uniform',
9 9 });
10 const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS_DEFAULT = 5;
11 const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS_MAX = 15;
10 const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS_DEFAULT = 15;
11 const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS_MAX = 30;
12 12 const IMAGE_SUBTITLE_PREFETCH_STEP_SECONDS = 0.5;
13 13
14 14 function normaliseTrackName (name)
@@ -7,8 +7,8 @@
7 backgroundOpacity: '0',
7 backgroundOpacity: '0',
8 edgeStyle: 'uniform',
8 edgeStyle: 'uniform',
9 });
9 });
10 const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS_DEFAULT = 5;
10 const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS_DEFAULT = 15;
11 const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS_MAX = 15;
11 const IMAGE_SUBTITLE_LOOKAHEAD_SECONDS_MAX = 30;
12 const IMAGE_SUBTITLE_PREFETCH_STEP_SECONDS = 0.5;
12 const IMAGE_SUBTITLE_PREFETCH_STEP_SECONDS = 0.5;
13
13
14 function normaliseTrackName (name)
14 function normaliseTrackName (name)