v2: mpegts.js + single-upstream fan-out hub (no FFmpeg/HLS)
Replaces the FFmpeg -> MediaMTX -> HLS pipeline with a raw MPEG-TS fan-out architecture: - Go stream.Hub holds ONE upstream connection per active channel and broadcasts the raw TS bytes to all connected browsers via /ts. The IPTV provider only ever sees one IP (the server), no matter how many viewers are watching (shared single-channel model). - Frontend uses mpegts.js to play the raw TS in-browser via MSE, fixing HEVC/H.265 4K streams that HLS could not package. - Dropped FFmpeg, MediaMTX, RTMP/RTSP, HLS proxy, playback/ingest modes, the OBS source toggle, and FFmpeg health stats. - UI look preserved (fullscreen video, collapsible sidebar, status bar, upstream-down banner, hourly playlist auto-refresh). Tradeoff: loses iOS Safari (no MSE/mpegts.js); fixes desktop/Android playback of both H.264 and H.265.
This commit is contained in:
@@ -4,22 +4,6 @@ interface Props {
|
||||
status: StreamStatus | null;
|
||||
}
|
||||
|
||||
function healthColor(speed: string): string {
|
||||
const n = parseFloat(speed);
|
||||
if (isNaN(n)) return "health-unknown";
|
||||
if (n >= 0.95) return "health-good";
|
||||
if (n >= 0.8) return "health-warn";
|
||||
return "health-bad";
|
||||
}
|
||||
|
||||
function healthLabel(speed: string): string {
|
||||
const n = parseFloat(speed);
|
||||
if (isNaN(n)) return "?";
|
||||
if (n >= 0.95) return "Good";
|
||||
if (n >= 0.8) return "Slow upstream";
|
||||
return "Upstream too slow";
|
||||
}
|
||||
|
||||
export default function StatusBar({ status }: Props) {
|
||||
if (!status) {
|
||||
return (
|
||||
@@ -30,19 +14,13 @@ export default function StatusBar({ status }: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
const h = status.health;
|
||||
|
||||
return (
|
||||
<div className="status-bar">
|
||||
<span className={`status-dot ${status.live ? "live" : "offline"}`} />
|
||||
<span className="status-text">
|
||||
{status.live ? "LIVE" : "Offline"}
|
||||
</span>
|
||||
<span className="status-separator">|</span>
|
||||
<span className="status-source">
|
||||
Source: {status.source === "obs" ? "OBS" : "IPTV"}
|
||||
</span>
|
||||
{status.source === "iptv" && status.channel_name && (
|
||||
{status.channel_name && (
|
||||
<>
|
||||
<span className="status-separator">|</span>
|
||||
<span className={`status-channel ${status.transitioning ? "channel-transitioning" : ""}`}>
|
||||
@@ -59,21 +37,6 @@ export default function StatusBar({ status }: Props) {
|
||||
<span className="upstream-down-banner">Upstream down?</span>
|
||||
</>
|
||||
)}
|
||||
{h && h.speed && (
|
||||
<span className="status-health">
|
||||
<span className="status-separator">|</span>
|
||||
<span className={`health-indicator ${healthColor(h.speed)}`}>
|
||||
{healthLabel(h.speed)}
|
||||
</span>
|
||||
<span className="health-stats">
|
||||
{h.speed} / {h.bitrate}
|
||||
{h.fps && h.fps !== "0.00" && <> / {h.fps}fps</>}
|
||||
{h.drop_frames !== "0" && (
|
||||
<span className="health-drops"> / {h.drop_frames} dropped</span>
|
||||
)}
|
||||
</span>
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user