Apply minimal caption overrides for Video.js defaults
@@ -86,7 +86,7 @@
86
86
- Standalone public share page served at /share/:token; no auth required.
87
87
- Timer bar - Live HH:MM:SS countdown showing remaining validity; turns red and disables download when expired.
88
88
- tryPreview(name, isDir) - Renders inline preview (img/video/audio/text pre); no-op for unsupported types or directories.
89
- Share video preview - Uses the same Video.js playback behaviour as app previews: VOD UI enforcement, long forward buffer, forced caption-style defaults, and subtitle/audio track restore/save by matching track names when available.
89
- Share video preview - Uses the same Video.js playback behaviour as app previews: VOD UI enforcement, long forward buffer, forced caption overrides (text background opacity transparent + text edge style uniform), and subtitle/audio track restore/save by matching track names when available.
90
90
- Fetches /api/share/info/:token on load; shows error state for 404/410 responses.
91
91
- Download link points to /api/share/download/:token; labelled "Download als .zip" for directories.
92
92
@@ -125,7 +125,7 @@
125
125
- disconnectThumbnailObserver() - Clears active IntersectionObserver when the grid is rebuilt.
126
126
- setThumbnailPending(iconEl, pending) - Toggles per-icon pending spinner state while a cached image thumbnail is not ready yet.
127
127
- buildThumbnailSource(item, blob, kind) - Produces thumbnail image source (data/blob URL) for icon injection.
128
- renderStreamedVideoPreview(item, targetEl) - Creates the Video.js player with HLS source/track config, enforces non-live playback UI for file streams, uses container-fill sizing to keep previews within bounds, restores per-user video prefs (volume + subtitle/audio track names when present), forces default caption style presets on each open, reports watch progress, and warns when subtitle streams exist but none are web-compatible.
128
- renderStreamedVideoPreview(item, targetEl) - Creates the Video.js player with HLS source/track config, enforces non-live playback UI for file streams, uses container-fill sizing to keep previews within bounds, restores per-user video prefs (volume + subtitle/audio track names when present), forces caption overrides on each open (text background opacity transparent + text edge style uniform), reports watch progress, and warns when subtitle streams exist but none are web-compatible.
129
129
- closePreview(opts) - Closes expanded previews; video previews ignore backdrop close and require explicit close action.
130
130
131
131
## tests/thumbnail-cache.test.js
@@ -205,7 +205,7 @@
205
205
- video preview restores saved subtitle/audio track names when available - Verifies per-user subtitle/audio selections are reapplied by matching track names.
206
206
- video preview keeps default tracks when saved names are not present - Verifies subtitle/audio defaults remain unchanged when saved names are missing.
207
207
- video preview saves subtitle/audio track names per user when selection changes - Verifies subtitle/audio selections are persisted into per-user video preferences.
208
- video preview applies default caption style per open - Verifies requested caption defaults are always loaded into Video.js settings.
208
- video preview applies caption overrides per open - Verifies requested caption overrides are always loaded into Video.js settings.
209
209
- video preview does not save caption style settings per user on close - Verifies caption style changes are not persisted to per-user video preferences.
210
210
211
211
## tests/video-stream.test.js
@@ -86,7 +86,7 @@86
- Standalone public share page served at /share/:token; no auth required.
86
- Standalone public share page served at /share/:token; no auth required.
87
- Timer bar - Live HH:MM:SS countdown showing remaining validity; turns red and disables download when expired.
87
- Timer bar - Live HH:MM:SS countdown showing remaining validity; turns red and disables download when expired.
88
- tryPreview(name, isDir) - Renders inline preview (img/video/audio/text pre); no-op for unsupported types or directories.
88
- tryPreview(name, isDir) - Renders inline preview (img/video/audio/text pre); no-op for unsupported types or directories.
89
- Share video preview - Uses the same Video.js playback behaviour as app previews: VOD UI enforcement, long forward buffer, forced caption-style defaults, and subtitle/audio track restore/save by matching track names when available.
89
- Share video preview - Uses the same Video.js playback behaviour as app previews: VOD UI enforcement, long forward buffer, forced caption overrides (text background opacity transparent + text edge style uniform), and subtitle/audio track restore/save by matching track names when available.
90
- Fetches /api/share/info/:token on load; shows error state for 404/410 responses.
90
- Fetches /api/share/info/:token on load; shows error state for 404/410 responses.
91
- Download link points to /api/share/download/:token; labelled "Download als .zip" for directories.
91
- Download link points to /api/share/download/:token; labelled "Download als .zip" for directories.
92
92
@@ -125,7 +125,7 @@125
- disconnectThumbnailObserver() - Clears active IntersectionObserver when the grid is rebuilt.
125
- disconnectThumbnailObserver() - Clears active IntersectionObserver when the grid is rebuilt.
126
- setThumbnailPending(iconEl, pending) - Toggles per-icon pending spinner state while a cached image thumbnail is not ready yet.
126
- setThumbnailPending(iconEl, pending) - Toggles per-icon pending spinner state while a cached image thumbnail is not ready yet.
127
- buildThumbnailSource(item, blob, kind) - Produces thumbnail image source (data/blob URL) for icon injection.
127
- buildThumbnailSource(item, blob, kind) - Produces thumbnail image source (data/blob URL) for icon injection.
128
- renderStreamedVideoPreview(item, targetEl) - Creates the Video.js player with HLS source/track config, enforces non-live playback UI for file streams, uses container-fill sizing to keep previews within bounds, restores per-user video prefs (volume + subtitle/audio track names when present), forces default caption style presets on each open, reports watch progress, and warns when subtitle streams exist but none are web-compatible.
128
- renderStreamedVideoPreview(item, targetEl) - Creates the Video.js player with HLS source/track config, enforces non-live playback UI for file streams, uses container-fill sizing to keep previews within bounds, restores per-user video prefs (volume + subtitle/audio track names when present), forces caption overrides on each open (text background opacity transparent + text edge style uniform), reports watch progress, and warns when subtitle streams exist but none are web-compatible.
129
- closePreview(opts) - Closes expanded previews; video previews ignore backdrop close and require explicit close action.
129
- closePreview(opts) - Closes expanded previews; video previews ignore backdrop close and require explicit close action.
130
130
131
## tests/thumbnail-cache.test.js
131
## tests/thumbnail-cache.test.js
@@ -205,7 +205,7 @@205
- video preview restores saved subtitle/audio track names when available - Verifies per-user subtitle/audio selections are reapplied by matching track names.
205
- video preview restores saved subtitle/audio track names when available - Verifies per-user subtitle/audio selections are reapplied by matching track names.
206
- video preview keeps default tracks when saved names are not present - Verifies subtitle/audio defaults remain unchanged when saved names are missing.
206
- video preview keeps default tracks when saved names are not present - Verifies subtitle/audio defaults remain unchanged when saved names are missing.
207
- video preview saves subtitle/audio track names per user when selection changes - Verifies subtitle/audio selections are persisted into per-user video preferences.
207
- video preview saves subtitle/audio track names per user when selection changes - Verifies subtitle/audio selections are persisted into per-user video preferences.
208
- video preview applies default caption style per open - Verifies requested caption defaults are always loaded into Video.js settings.
208
- video preview applies caption overrides per open - Verifies requested caption overrides are always loaded into Video.js settings.
209
- video preview does not save caption style settings per user on close - Verifies caption style changes are not persisted to per-user video preferences.
209
- video preview does not save caption style settings per user on close - Verifies caption style changes are not persisted to per-user video preferences.
210
210
211
## tests/video-stream.test.js
211
## tests/video-stream.test.js
@@ -65,16 +65,9 @@ const MOBILE_LONG_PRESS_MOVE_THRESHOLD = 10;
65
65
const THUMB_OBSERVER_ROOT_MARGIN = '120px';
66
66
const VIDEO_PREFS_KEY_PREFIX = 'filemanager.video-prefs.v1.';
67
67
const VIDEO_TEXT_TRACK_SETTINGS_KEY = 'vjs-text-track-settings';
68
const VIDEO_TEXT_TRACK_DEFAULT_SETTINGS_RAW = JSON.stringify({
69
color: '#fff',
70
textOpacity: '1',
71
backgroundColor: '#000',
68
const VIDEO_TEXT_TRACK_OVERRIDE_SETTINGS_RAW = JSON.stringify({
72
69
backgroundOpacity: '0',
73
windowColor: '#000',
74
windowOpacity: '0',
75
fontPercent: '1.00',
76
70
edgeStyle: 'uniform',
77
fontFamily: 'proportionalSansSerif',
78
71
});
79
72
const VIDEO_FORWARD_BUFFER_SECONDS = 60 * 60;
80
73
let videoJsLoaderPromise = null;
@@ -250,8 +243,8 @@ function applyUserVideoTextTrackPrefs ()
250
243
{
251
244
try
252
245
{
253
// Always force known caption defaults to avoid stale user overrides.
254
localStorage.setItem(VIDEO_TEXT_TRACK_SETTINGS_KEY, VIDEO_TEXT_TRACK_DEFAULT_SETTINGS_RAW);
246
// Only override the two requested defaults and leave other settings at Video.js defaults.
247
localStorage.setItem(VIDEO_TEXT_TRACK_SETTINGS_KEY, VIDEO_TEXT_TRACK_OVERRIDE_SETTINGS_RAW);
255
248
} catch
256
249
{
257
250
// Ignore localStorage failures.
@@ -65,16 +65,9 @@ const MOBILE_LONG_PRESS_MOVE_THRESHOLD = 10;65
const THUMB_OBSERVER_ROOT_MARGIN = '120px';65
const THUMB_OBSERVER_ROOT_MARGIN = '120px';66
const VIDEO_PREFS_KEY_PREFIX = 'filemanager.video-prefs.v1.';66
const VIDEO_PREFS_KEY_PREFIX = 'filemanager.video-prefs.v1.';67
const VIDEO_TEXT_TRACK_SETTINGS_KEY = 'vjs-text-track-settings';67
const VIDEO_TEXT_TRACK_SETTINGS_KEY = 'vjs-text-track-settings';68
const VIDEO_TEXT_TRACK_DEFAULT_SETTINGS_RAW = JSON.stringify({68
const VIDEO_TEXT_TRACK_OVERRIDE_SETTINGS_RAW = JSON.stringify({69
color: '#fff',70
textOpacity: '1',71
backgroundColor: '#000',72
backgroundOpacity: '0',69
backgroundOpacity: '0',73
windowColor: '#000',74
windowOpacity: '0',75
fontPercent: '1.00',76
edgeStyle: 'uniform',70
edgeStyle: 'uniform',77
fontFamily: 'proportionalSansSerif',78
});71
});79
const VIDEO_FORWARD_BUFFER_SECONDS = 60 * 60;72
const VIDEO_FORWARD_BUFFER_SECONDS = 60 * 60;80
let videoJsLoaderPromise = null;73
let videoJsLoaderPromise = null;@@ -250,8 +243,8 @@ function applyUserVideoTextTrackPrefs ()250
{243
{251
try244
try252
{245
{253
// Always force known caption defaults to avoid stale user overrides.246
// Only override the two requested defaults and leave other settings at Video.js defaults.254
localStorage.setItem(VIDEO_TEXT_TRACK_SETTINGS_KEY, VIDEO_TEXT_TRACK_DEFAULT_SETTINGS_RAW);247
localStorage.setItem(VIDEO_TEXT_TRACK_SETTINGS_KEY, VIDEO_TEXT_TRACK_OVERRIDE_SETTINGS_RAW);255
} catch248
} catch256
{249
{257
// Ignore localStorage failures.250
// Ignore localStorage failures.@@ -7,15 +7,8 @@ const { once } = require('events');
7
7
const { webcrypto } = require('crypto');
8
8
9
9
const DEFAULT_VIDEO_TEXT_TRACK_SETTINGS_RAW = JSON.stringify({
10
color: '#fff',
11
textOpacity: '1',
12
backgroundColor: '#000',
13
10
backgroundOpacity: '0',
14
windowColor: '#000',
15
windowOpacity: '0',
16
fontPercent: '1.00',
17
11
edgeStyle: 'uniform',
18
fontFamily: 'proportionalSansSerif',
19
12
});
20
13
21
14
describe('page load smoke test', () =>
@@ -7,15 +7,8 @@ const { once } = require('events');7
const { webcrypto } = require('crypto');
7
const { webcrypto } = require('crypto');
8
8
9
const DEFAULT_VIDEO_TEXT_TRACK_SETTINGS_RAW = JSON.stringify({
9
const DEFAULT_VIDEO_TEXT_TRACK_SETTINGS_RAW = JSON.stringify({
10
color: '#fff',
11
textOpacity: '1',
12
backgroundColor: '#000',
13
backgroundOpacity: '0',
10
backgroundOpacity: '0',
14
windowColor: '#000',
15
windowOpacity: '0',
16
fontPercent: '1.00',
17
edgeStyle: 'uniform',
11
edgeStyle: 'uniform',
18
fontFamily: 'proportionalSansSerif',
19
});
12
});
20
13
21
describe('page load smoke test', () =>
14
describe('page load smoke test', () =>