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' ? ( + 虎牙 + ) : ( + + )}