mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-06-14 03:32:00 +08:00
chroe: 不再配置 iceCandidatePoolSize,沿用浏览器默认
This commit is contained in:
@@ -128,13 +128,6 @@ function setConnectStage(stage: WebRTCConnectStage, details?: unknown) {
|
|||||||
videoDebugLog(`WebRTC stage -> ${stage}`, details)
|
videoDebugLog(`WebRTC stage -> ${stage}`, details)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getIceCandidatePoolSize(): number {
|
|
||||||
if (typeof window === 'undefined') return 0
|
|
||||||
const icePoolParam = new URLSearchParams(window.location.search).get('ice_pool')
|
|
||||||
if (icePoolParam === null) return 0
|
|
||||||
return Math.max(0, Number.parseInt(icePoolParam, 10) || 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
function summarizeIceCandidate(candidate: RTCIceCandidate | IceCandidate | RTCIceCandidateInit | null) {
|
function summarizeIceCandidate(candidate: RTCIceCandidate | IceCandidate | RTCIceCandidateInit | null) {
|
||||||
if (!candidate) return null
|
if (!candidate) return null
|
||||||
const candidateLine = candidate.candidate ?? ''
|
const candidateLine = candidate.candidate ?? ''
|
||||||
@@ -158,10 +151,7 @@ function summarizeIceCandidate(candidate: RTCIceCandidate | IceCandidate | RTCIc
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createPeerConnection(iceServers: RTCIceServer[]): RTCPeerConnection {
|
function createPeerConnection(iceServers: RTCIceServer[]): RTCPeerConnection {
|
||||||
const config: RTCConfiguration = {
|
const config: RTCConfiguration = { iceServers }
|
||||||
iceServers,
|
|
||||||
iceCandidatePoolSize: getIceCandidatePoolSize(),
|
|
||||||
}
|
|
||||||
|
|
||||||
const pc = new RTCPeerConnection(config)
|
const pc = new RTCPeerConnection(config)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user