@geekapps/silo-elements-nextjs 0.3.15 → 0.3.16
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/dist/VideoPlayer.js +22 -4
- package/dist/VideoPlayer.js.map +1 -1
- package/dist/index.js +22 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/VideoPlayer.js
CHANGED
|
@@ -763,14 +763,18 @@ function Video({
|
|
|
763
763
|
const hls = new Hls({
|
|
764
764
|
enableWorker: true,
|
|
765
765
|
maxBufferLength: 30,
|
|
766
|
-
maxMaxBufferLength:
|
|
767
|
-
maxBufferSize:
|
|
766
|
+
maxMaxBufferLength: 120,
|
|
767
|
+
maxBufferSize: 120 * 1e3 * 1e3,
|
|
768
768
|
backBufferLength: 30,
|
|
769
769
|
maxBufferHole: 0.5,
|
|
770
|
-
|
|
770
|
+
// Be patient with large 4K/HDR fragments before declaring a stall
|
|
771
|
+
highBufferWatchdogPeriod: 5,
|
|
772
|
+
nudgeOffset: 0.2,
|
|
773
|
+
nudgeMaxRetry: 3,
|
|
771
774
|
startLevel: -1,
|
|
772
775
|
abrBandWidthFactor: 0.95,
|
|
773
|
-
abrBandWidthUpFactor: 0.7
|
|
776
|
+
abrBandWidthUpFactor: 0.7,
|
|
777
|
+
abrEwmaDefaultEstimate: 5e6
|
|
774
778
|
});
|
|
775
779
|
hlsRef.current = hls;
|
|
776
780
|
let pinnedLevel = -1;
|
|
@@ -846,6 +850,7 @@ function Video({
|
|
|
846
850
|
});
|
|
847
851
|
let mediaErrorAttempts = 0;
|
|
848
852
|
let audioAppendErrors = 0;
|
|
853
|
+
let stalledOnPinnedLevel = 0;
|
|
849
854
|
hls.on(Hls.Events.ERROR, (_, data) => {
|
|
850
855
|
const fragUrl = (data.frag?.url ?? data.url ?? "").slice(-80);
|
|
851
856
|
const fragType = data.frag?.type ?? "?";
|
|
@@ -866,6 +871,19 @@ function Video({
|
|
|
866
871
|
} else {
|
|
867
872
|
audioAppendErrors = 0;
|
|
868
873
|
}
|
|
874
|
+
if (data.details === Hls.ErrorDetails.BUFFER_STALLED_ERROR && pinnedLevel >= 0) {
|
|
875
|
+
stalledOnPinnedLevel += 1;
|
|
876
|
+
if (stalledOnPinnedLevel >= 4) {
|
|
877
|
+
stalledOnPinnedLevel = 0;
|
|
878
|
+
const nextLevel = Math.max(0, pinnedLevel - 1);
|
|
879
|
+
console.warn("[Silo/hls] repeated stalls on pinned level", pinnedLevel, "\u2014 stepping down to", nextLevel);
|
|
880
|
+
pinnedLevel = nextLevel;
|
|
881
|
+
hls.currentLevel = nextLevel;
|
|
882
|
+
setSelectedQuality(nextLevel === 0 ? "auto" : `hls-${nextLevel}`);
|
|
883
|
+
}
|
|
884
|
+
} else if (data.details !== Hls.ErrorDetails.BUFFER_STALLED_ERROR) {
|
|
885
|
+
stalledOnPinnedLevel = 0;
|
|
886
|
+
}
|
|
869
887
|
return;
|
|
870
888
|
}
|
|
871
889
|
if (data.details === Hls.ErrorDetails.FRAG_PARSING_ERROR && fragType === "audio") {
|