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() {