vidply 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@
11
11
  "format": "esm"
12
12
  },
13
13
  "src/i18n/translations.js": {
14
- "bytes": 17011,
14
+ "bytes": 22406,
15
15
  "imports": [],
16
16
  "format": "esm"
17
17
  },
@@ -38,12 +38,12 @@
38
38
  "format": "esm"
39
39
  },
40
40
  "src/icons/Icons.js": {
41
- "bytes": 12539,
41
+ "bytes": 12746,
42
42
  "imports": [],
43
43
  "format": "esm"
44
44
  },
45
45
  "src/controls/ControlBar.js": {
46
- "bytes": 74720,
46
+ "bytes": 75033,
47
47
  "imports": [
48
48
  {
49
49
  "path": "src/utils/DOMUtils.js",
@@ -68,8 +68,13 @@
68
68
  ],
69
69
  "format": "esm"
70
70
  },
71
+ "src/utils/StorageManager.js": {
72
+ "bytes": 3444,
73
+ "imports": [],
74
+ "format": "esm"
75
+ },
71
76
  "src/controls/CaptionManager.js": {
72
- "bytes": 7467,
77
+ "bytes": 8830,
73
78
  "imports": [
74
79
  {
75
80
  "path": "src/utils/DOMUtils.js",
@@ -80,6 +85,11 @@
80
85
  "path": "src/i18n/i18n.js",
81
86
  "kind": "import-statement",
82
87
  "original": "../i18n/i18n.js"
88
+ },
89
+ {
90
+ "path": "src/utils/StorageManager.js",
91
+ "kind": "import-statement",
92
+ "original": "../utils/StorageManager.js"
83
93
  }
84
94
  ],
85
95
  "format": "esm"
@@ -90,7 +100,7 @@
90
100
  "format": "esm"
91
101
  },
92
102
  "src/controls/TranscriptManager.js": {
93
- "bytes": 24133,
103
+ "bytes": 59186,
94
104
  "imports": [
95
105
  {
96
106
  "path": "src/utils/DOMUtils.js",
@@ -111,6 +121,11 @@
111
121
  "path": "src/i18n/i18n.js",
112
122
  "kind": "import-statement",
113
123
  "original": "../i18n/i18n.js"
124
+ },
125
+ {
126
+ "path": "src/utils/StorageManager.js",
127
+ "kind": "import-statement",
128
+ "original": "../utils/StorageManager.js"
114
129
  }
115
130
  ],
116
131
  "format": "esm"
@@ -142,7 +157,7 @@
142
157
  "format": "esm"
143
158
  },
144
159
  "src/core/Player.js": {
145
- "bytes": 39618,
160
+ "bytes": 61179,
146
161
  "imports": [
147
162
  {
148
163
  "path": "src/utils/EventEmitter.js",
@@ -203,6 +218,11 @@
203
218
  "path": "src/i18n/i18n.js",
204
219
  "kind": "import-statement",
205
220
  "original": "../i18n/i18n.js"
221
+ },
222
+ {
223
+ "path": "src/utils/StorageManager.js",
224
+ "kind": "import-statement",
225
+ "original": "../utils/StorageManager.js"
206
226
  }
207
227
  ],
208
228
  "format": "esm"
@@ -247,10 +267,10 @@
247
267
  "entryPoint": "src/index.js",
248
268
  "inputs": {
249
269
  "src/renderers/HTML5Renderer.js": {
250
- "bytesInOutput": 4670
270
+ "bytesInOutput": 4671
251
271
  },
252
272
  "src/index.js": {
253
- "bytesInOutput": 1064
273
+ "bytesInOutput": 1070
254
274
  },
255
275
  "src/utils/EventEmitter.js": {
256
276
  "bytesInOutput": 436
@@ -259,7 +279,7 @@
259
279
  "bytesInOutput": 1581
260
280
  },
261
281
  "src/i18n/translations.js": {
262
- "bytesInOutput": 13713
282
+ "bytesInOutput": 19604
263
283
  },
264
284
  "src/i18n/i18n.js": {
265
285
  "bytesInOutput": 720
@@ -268,22 +288,25 @@
268
288
  "bytesInOutput": 839
269
289
  },
270
290
  "src/icons/Icons.js": {
271
- "bytesInOutput": 10407
291
+ "bytesInOutput": 10590
272
292
  },
273
293
  "src/controls/ControlBar.js": {
274
- "bytesInOutput": 36374
294
+ "bytesInOutput": 36459
295
+ },
296
+ "src/utils/StorageManager.js": {
297
+ "bytesInOutput": 1606
275
298
  },
276
299
  "src/controls/CaptionManager.js": {
277
- "bytesInOutput": 3599
300
+ "bytesInOutput": 4395
278
301
  },
279
302
  "src/controls/KeyboardManager.js": {
280
303
  "bytesInOutput": 3738
281
304
  },
282
305
  "src/controls/TranscriptManager.js": {
283
- "bytesInOutput": 12461
306
+ "bytesInOutput": 31200
284
307
  },
285
308
  "src/core/Player.js": {
286
- "bytesInOutput": 18100
309
+ "bytesInOutput": 26599
287
310
  },
288
311
  "src/renderers/YouTubeRenderer.js": {
289
312
  "bytesInOutput": 4140
@@ -298,7 +321,7 @@
298
321
  "bytesInOutput": 8100
299
322
  }
300
323
  },
301
- "bytes": 130149
324
+ "bytes": 165967
302
325
  }
303
326
  }
304
327
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vidply",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Universal, accessible video & audio player with ES6 modules",
5
5
  "type": "module",
6
6
  "main": "dist/vidply.js",
@@ -4,6 +4,7 @@
4
4
 
5
5
  import {DOMUtils} from '../utils/DOMUtils.js';
6
6
  import {i18n} from '../i18n/i18n.js';
7
+ import {StorageManager} from '../utils/StorageManager.js';
7
8
 
8
9
  export class CaptionManager {
9
10
  constructor(player) {
@@ -12,9 +13,37 @@ export class CaptionManager {
12
13
  this.tracks = [];
13
14
  this.currentTrack = null;
14
15
  this.currentCue = null;
16
+
17
+ // Storage manager
18
+ this.storage = new StorageManager('vidply');
19
+
20
+ // Load saved preferences
21
+ this.loadSavedPreferences();
15
22
 
16
23
  this.init();
17
24
  }
25
+
26
+ loadSavedPreferences() {
27
+ const saved = this.storage.getCaptionPreferences();
28
+ if (saved) {
29
+ // Override player options with saved preferences
30
+ if (saved.fontSize) this.player.options.captionsFontSize = saved.fontSize;
31
+ if (saved.fontFamily) this.player.options.captionsFontFamily = saved.fontFamily;
32
+ if (saved.color) this.player.options.captionsColor = saved.color;
33
+ if (saved.backgroundColor) this.player.options.captionsBackgroundColor = saved.backgroundColor;
34
+ if (saved.opacity !== undefined) this.player.options.captionsOpacity = saved.opacity;
35
+ }
36
+ }
37
+
38
+ saveCaptionPreferences() {
39
+ this.storage.saveCaptionPreferences({
40
+ fontSize: this.player.options.captionsFontSize,
41
+ fontFamily: this.player.options.captionsFontFamily,
42
+ color: this.player.options.captionsColor,
43
+ backgroundColor: this.player.options.captionsBackgroundColor,
44
+ opacity: this.player.options.captionsOpacity
45
+ });
46
+ }
18
47
 
19
48
  init() {
20
49
  this.createElement();
@@ -218,6 +247,7 @@ export class CaptionManager {
218
247
  }
219
248
 
220
249
  this.updateStyles();
250
+ this.saveCaptionPreferences();
221
251
  this.player.emit('captionschange');
222
252
  }
223
253
 
@@ -316,7 +316,14 @@ export class ControlBar {
316
316
  }
317
317
 
318
318
  hasAudioDescription() {
319
- return this.player.audioDescriptionSrc && this.player.audioDescriptionSrc.length > 0;
319
+ // Check for audio-described video source OR description tracks
320
+ if (this.player.audioDescriptionSrc && this.player.audioDescriptionSrc.length > 0) {
321
+ return true;
322
+ }
323
+
324
+ // Check for description tracks
325
+ const textTracks = Array.from(this.player.element.textTracks || []);
326
+ return textTracks.some(track => track.kind === 'descriptions');
320
327
  }
321
328
 
322
329
  hasSignLanguage() {
@@ -1118,9 +1125,9 @@ export class ControlBar {
1118
1125
  i18n.t('styleLabels.fontSize'),
1119
1126
  'captionsFontSize',
1120
1127
  [
1121
- {label: i18n.t('fontSizes.small'), value: '80%'},
1122
- {label: i18n.t('fontSizes.medium'), value: '100%'},
1123
- {label: i18n.t('fontSizes.large'), value: '120%'},
1128
+ {label: i18n.t('fontSizes.small'), value: '87.5%'},
1129
+ {label: i18n.t('fontSizes.normal'), value: '100%'},
1130
+ {label: i18n.t('fontSizes.large'), value: '125%'},
1124
1131
  {label: i18n.t('fontSizes.xlarge'), value: '150%'}
1125
1132
  ]
1126
1133
  );
@@ -230,9 +230,9 @@ export class SettingsDialog {
230
230
 
231
231
  // Font size
232
232
  section.appendChild(this.createCaptionStyleControl('fontSize', i18n.t('captions.fontSize'), [
233
- { label: i18n.t('fontSizes.small'), value: '80%' },
234
- { label: i18n.t('fontSizes.medium'), value: '100%' },
235
- { label: i18n.t('fontSizes.large'), value: '120%' },
233
+ { label: i18n.t('fontSizes.small'), value: '87.5%' },
234
+ { label: i18n.t('fontSizes.normal'), value: '100%' },
235
+ { label: i18n.t('fontSizes.large'), value: '125%' },
236
236
  { label: i18n.t('fontSizes.xlarge'), value: '150%' }
237
237
  ]));
238
238