From 7ef9737cb6fc2b05870f52418dbf5fad43c22729 Mon Sep 17 00:00:00 2001 From: mtvpls Date: Tue, 20 Jan 2026 19:47:39 +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=E4=BD=BF=E7=94=A8=E5=8E=9F=E5=A7=8B=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/api/web-live/stream/route.ts | 5 ++++- src/app/web-live/page.tsx | 26 ++++++++++++++------------ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/app/api/web-live/stream/route.ts b/src/app/api/web-live/stream/route.ts index c5a627a..0432772 100644 --- a/src/app/api/web-live/stream/route.ts +++ b/src/app/api/web-live/stream/route.ts @@ -59,7 +59,10 @@ export async function GET(request: NextRequest) { const streamUrl = `${sFlvUrl}/${sStreamName}.${sFlvUrlSuffix}?${newAntiCode}`; const proxyUrl = `/api/web-live/proxy/proxy.flv?url=${encodeURIComponent(streamUrl)}`; - return NextResponse.json({ url: proxyUrl }); + return NextResponse.json({ + url: proxyUrl, + originalUrl: streamUrl + }); } return NextResponse.json({ error: '不支持的平台' }, { status: 400 }); diff --git a/src/app/web-live/page.tsx b/src/app/web-live/page.tsx index eef87dc..50d5f0d 100644 --- a/src/app/web-live/page.tsx +++ b/src/app/web-live/page.tsx @@ -18,6 +18,7 @@ export default function WebLivePage() { const [sources, setSources] = useState([]); const [currentSource, setCurrentSource] = useState(null); const [videoUrl, setVideoUrl] = useState(''); + const [originalVideoUrl, setOriginalVideoUrl] = useState(''); const [activeTab, setActiveTab] = useState<'rooms' | 'platforms'>('rooms'); const [isChannelListCollapsed, setIsChannelListCollapsed] = useState(false); const [isVideoLoading, setIsVideoLoading] = useState(false); @@ -119,6 +120,7 @@ export default function WebLivePage() { if (res.ok) { const data = await res.json(); setVideoUrl(data.url); + setOriginalVideoUrl(data.originalUrl || data.url); } else { const data = await res.json(); setErrorMessage(data.error || '获取直播流失败'); @@ -321,8 +323,8 @@ export default function WebLivePage() {