@nomercy-entertainment/nomercy-video-player 2.2.3 → 2.2.4

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [2.2.4] — 2026-10-08
6
+
7
+ ### Fixed
8
+
9
+ - Core 2.2.4: the saved volume no longer turns to 0 after a mute.
10
+ - A language-only caption pick now lands on the full track before a sign-language or forced one.
11
+ - Only the viewer's own caption pick is remembered.
12
+ - The viewer's caption size now applies to ASS tracks and redraws when it changes.
13
+
5
14
  ## [2.2.3] — 2026-09-25
6
15
 
7
16
  ### Added
package/dist/index.d.ts CHANGED
@@ -205,6 +205,10 @@ export declare class NMVideoPlayer<T extends VideoPlaylistItem = VideoPlaylistIt
205
205
  * instead. No warning either way.
206
206
  */
207
207
  private _applyDefaultTracks;
208
+ /** True while the player picks a caption itself; such a pick is never remembered. */
209
+ private _selectingDefaults;
210
+ private _selectDefaultSubtitle;
211
+ private _selectDefaultAudio;
208
212
  /** Test-only: clear the registry. Not part of the public API. */
209
213
  static _resetRegistry(): void;
210
214
  registerStream: (factory: IStreamFactory, prepend?: boolean) => this;
package/dist/index.js CHANGED
@@ -115,12 +115,16 @@ export class NMVideoPlayer extends EventEmitter {
115
115
  // Record the chosen LANGUAGE, not the index — an index means a different
116
116
  // language on the next file. Fires for the viewer's own pick and for the
117
117
  // selection _applyDefaultTracks restores, which write the same value.
118
+ // The caption slot below is different: only the viewer's pick is kept.
118
119
  this.on('audioTrack', ({ id }) => {
119
120
  if (id === null)
120
121
  return;
121
122
  this.languageMemory.rememberAudio(this.audioTracks()[id]?.language);
122
123
  });
123
124
  this.on('subtitle', ({ track }) => {
125
+ // A pick _applyDefaultTracks makes is the player's, not the viewer's.
126
+ if (this._selectingDefaults)
127
+ return;
124
128
  this.languageMemory.rememberSubtitle(track === null ? SUBTITLES_OFF : this.subtitles()[track]);
125
129
  });
126
130
  // Re-emit videoRect on signals that change the displayed content rect.
@@ -217,6 +221,18 @@ export class NMVideoPlayer extends EventEmitter {
217
221
  * instead. No warning either way.
218
222
  */
219
223
  _applyDefaultTracks() {
224
+ this._selectingDefaults = true;
225
+ try {
226
+ this._selectDefaultSubtitle();
227
+ }
228
+ finally {
229
+ this._selectingDefaults = false;
230
+ }
231
+ this._selectDefaultAudio();
232
+ }
233
+ /** True while the player picks a caption itself; such a pick is never remembered. */
234
+ _selectingDefaults = false;
235
+ _selectDefaultSubtitle() {
220
236
  const remembered = this.languageMemory.subtitleChoice();
221
237
  const wanted = remembered
222
238
  ?? (this.options?.defaultSubtitleLanguage
@@ -236,6 +252,8 @@ export class NMVideoPlayer extends EventEmitter {
236
252
  this.subtitle(matchIdx);
237
253
  }
238
254
  }
255
+ }
256
+ _selectDefaultAudio() {
239
257
  const audioLang = this.languageMemory.audioLanguage() ?? this.options?.defaultAudioLanguage;
240
258
  const selectedIdx = this.audioTrack()?.index ?? null;
241
259
  // Nothing to honour and no selection that could have gone stale — leave