From 037a7e72497d9e27c3a5ff10d4191b0133aecdc8 Mon Sep 17 00:00:00 2001 From: mtvpls Date: Tue, 20 Jan 2026 15:43:21 +0800 Subject: [PATCH] =?UTF-8?q?weblive=E5=A4=96=E9=83=A8=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/api/admin/web-live/route.ts | 2 +- src/app/web-live/page.tsx | 189 +++++++++++++++++++++++++++- 2 files changed, 188 insertions(+), 3 deletions(-) diff --git a/src/app/api/admin/web-live/route.ts b/src/app/api/admin/web-live/route.ts index 374f473..9464bbb 100644 --- a/src/app/api/admin/web-live/route.ts +++ b/src/app/api/admin/web-live/route.ts @@ -104,7 +104,7 @@ export async function POST(request: NextRequest) { } const sortedSources = keys .map((key) => config.WebLiveConfig!.find((s) => s.key === key)) - .filter((s) => s !== undefined); + .filter((s): s is NonNullable => s !== undefined); config.WebLiveConfig = sortedSources; break; } diff --git a/src/app/web-live/page.tsx b/src/app/web-live/page.tsx index 69460cc..eef87dc 100644 --- a/src/app/web-live/page.tsx +++ b/src/app/web-live/page.tsx @@ -131,6 +131,13 @@ export default function WebLivePage() { } }; + const getRoomUrl = (source: any) => { + if (source.platform === 'huya') { + return `https://huya.com/${source.roomId}`; + } + return ''; + }; + const platforms = Array.from(new Set(sources.map(s => s.platform))); if (loading) { @@ -273,6 +280,180 @@ export default function WebLivePage() { )} + + {/* 外部播放器按钮 */} + {currentSource && ( +
+
+
+ {/* 网页播放 */} + + + {/* PotPlayer */} + + + {/* VLC */} + + + {/* MPV */} + + + {/* MX Player */} + + + {/* nPlayer */} + + + {/* IINA */} + +
+
+
+ )}
@@ -332,8 +513,12 @@ export default function WebLivePage() { {platforms.length > 0 ? ( platforms.map((platform) => (
-
- +
+ {platform === 'huya' ? ( + 虎牙 + ) : ( + + )}