电视直播代理控制权从客户端改为服务端

This commit is contained in:
mtvpls
2026-03-16 15:47:12 +08:00
parent 3bec268481
commit fe210c26cb
5 changed files with 86 additions and 42 deletions
+5 -4
View File
@@ -53,6 +53,7 @@ interface LiveSource {
from: 'config' | 'custom';
channelNumber?: number;
disabled?: boolean;
proxyMode?: boolean; // 代理模式开关
}
function LivePageClient() {
@@ -1344,10 +1345,10 @@ function LivePageClient() {
(context as any).type === 'manifest' ||
(context as any).type === 'level'
) {
// 判断是否浏览器直连
const isLiveDirectConnectStr = localStorage.getItem('liveDirectConnect');
const isLiveDirectConnect = isLiveDirectConnectStr === 'true';
if (isLiveDirectConnect) {
// 判断当前直播源是否启用代理模式
const currentLiveSource = currentSourceRef.current;
const isDirectConnect = currentLiveSource?.proxyMode === false;
if (isDirectConnect) {
// 浏览器直连,使用 URL 对象处理参数
try {
const url = new URL(context.url);