v2: tune playback for bursty upstream + clean overflow handling

- Player: match webplayer.online's proven mpegts.js live-sync config
  (deep 30-90s buffer, 45s target latency, 1.1x catch-up). The upstream
  delivers in bursts with multi-second gaps (measured up to ~6s); the
  deep buffer rides over them so 4K HEVC plays smoothly.
- Hub: on subscriber buffer overflow, cleanly disconnect the client so
  it reconnects and resyncs from a TS packet boundary instead of
  dropping bytes mid-stream (which corrupted alignment / sync_byte).
- Enlarge per-client buffer (256 -> 2048 chunks).
- Refresh real1.m3u from upstream.
This commit is contained in:
2026-06-12 19:48:33 -07:00
parent 723ae1f1ac
commit 03296e7572
4 changed files with 410 additions and 328 deletions

View File

@@ -83,8 +83,13 @@ export default function Player({ live, streamKey }: Props) {
}, 5000);
};
function start() {
destroyPlayer();
// Config mirrors webplayer.online (proven on this exact bursty upstream):
// a deep 30-90s live buffer absorbs the upstream's multi-second delivery
// gaps, while gentle 1.1x catch-up keeps latency bounded.
const player = mpegts.createPlayer(
{ type: "mpegts", isLive: true, url: src },
{
@@ -96,7 +101,11 @@ export default function Player({ live, streamKey }: Props) {
liveSyncTargetLatency: 45,
liveSyncPlaybackRate: 1.1,
liveBufferLatencyChasing: true,
liveBufferLatencyMaxLatency: 90,
liveBufferLatencyMinRemain: 30,
autoCleanupSourceBuffer: true,
autoCleanupMaxBackwardDuration: 120,
autoCleanupMinBackwardDuration: 90,
fixAudioTimestampGap: true,
lazyLoad: false,
}