pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

update auto level stuff

Pas f4f2f919 4143e970

+8 -4
+7 -2
src/components/player/display/base.ts
··· 169 169 hls.currentLevel = -1; 170 170 hls.loadLevel = -1; 171 171 } 172 - const quality = hlsLevelToQuality(hls.levels[hls.currentLevel]); 173 - emit("changedquality", quality); 172 + // Only emit quality when we have a valid level index (>= 0) 173 + // When automaticQuality is true, currentLevel is -1, so we wait for LEVEL_SWITCHED event 174 + if (hls.currentLevel >= 0) { 175 + const quality = hlsLevelToQuality(hls.levels[hls.currentLevel]); 176 + emit("changedquality", quality); 177 + } 174 178 } 175 179 176 180 function setupSource(vid: HTMLVideoElement, src: LoadableSource) { ··· 189 193 autoStartLoad: true, 190 194 maxBufferLength: 120, // 120 seconds 191 195 maxMaxBufferLength: 240, 196 + abrEwmaDefaultEstimate: 5 * 1000 * 1000, // 5 Mbps default bandwidth estimate for better ABR decisions 192 197 fragLoadPolicy: { 193 198 default: { 194 199 maxLoadTimeMs: 30 * 1000, // allow it load extra long, fragments are slow if requested for the first time on an origin
+1 -2
src/stores/player/slices/source.ts
··· 253 253 }, 254 254 redisplaySource(startAt: number) { 255 255 const store = get(); 256 - const quality = store.currentQuality; 257 256 if (!store.source) return; 258 257 const qualityPreferences = useQualityStore.getState(); 259 258 const loadableStream = selectQuality(store.source, { 260 259 automaticQuality: qualityPreferences.quality.automaticQuality, 261 - lastChosenQuality: quality, 260 + lastChosenQuality: qualityPreferences.quality.lastChosenQuality, 262 261 }); 263 262 set((s) => { 264 263 s.interface.error = undefined;