mirror of
https://github.com/p-stream/p-stream.git
synced 2026-01-11 20:10:32 +00:00
fix auto quality from changing when disabled
meow
This commit is contained in:
parent
70d226af70
commit
92a88e4638
1 changed files with 9 additions and 2 deletions
|
|
@ -308,8 +308,15 @@ export function makeVideoElementDisplayInterface(): DisplayInterface {
|
|||
});
|
||||
hls.on(Hls.Events.LEVEL_SWITCHED, () => {
|
||||
if (!hls) return;
|
||||
const quality = hlsLevelToQuality(hls.levels[hls.currentLevel]);
|
||||
emit("changedquality", quality);
|
||||
if (automaticQuality) {
|
||||
// Only emit quality changes when automatic quality is enabled
|
||||
const quality = hlsLevelToQuality(hls.levels[hls.currentLevel]);
|
||||
emit("changedquality", quality);
|
||||
} else {
|
||||
// When automatic quality is disabled, re-lock to preferred quality
|
||||
// This prevents HLS.js from switching levels unexpectedly
|
||||
setupQualityForHls();
|
||||
}
|
||||
});
|
||||
hls.on(Hls.Events.SUBTITLE_TRACK_LOADED, () => {
|
||||
for (const [lang, resolve] of languagePromises) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue