mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 09:01:03 -08:00
fix(embedded-mpv): do not restart the stream on every volume change
Same root cause as the loading-loop fix: the session-creation effect read this.volume() while building startSession's initialVolume argument, which made volume a tracked dependency of the effect. Each volume tick re-ran the effect, the cleanup disposed the active session, and a fresh one was created — which for VOD/series meant restarting playback from the beginning. Read volume via untracked() inside the effect. The value is only needed once at session creation; subsequent volume changes flow through controller.applyVolume() and never go near the effect. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: f957cd9849e0
This commit is contained in:
1 parent
6ab62cfd8d
commit
c12b660594
1 file changed
+6
-1
@@ -10,6 +10,7 @@ import {
|
||||
inject,
|
||||
input,
|
||||
signal,
|
||||
untracked,
|
||||
viewChild,
|
||||
} from '@angular/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
@@ -271,10 +272,14 @@ export class EmbeddedMpvPlayerComponent implements OnDestroy {
|
||||
return;
|
||||
}
|
||||
|
||||
// volume is read untracked so adjusting it during playback does
|
||||
// not re-trigger this effect (which would tear down and recreate
|
||||
// the session, restarting the stream from the beginning).
|
||||
// Subsequent volume changes flow through controller.applyVolume.
|
||||
const teardown = this.controller.startSession(
|
||||
viewport.nativeElement,
|
||||
playback,
|
||||
this.volume()
|
||||
untracked(() => this.volume())
|
||||
);
|
||||
onCleanup(teardown);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user