[*] 细节调整

This commit is contained in:
acgist
2023-04-25 08:37:22 +08:00
parent c6a5f1d1e0
commit 4cda1ef114
11 changed files with 109 additions and 53 deletions

View File

@@ -289,6 +289,9 @@ class Session {
if(this.closed) {
return;
}
if(!candidate || candidate.sdpMid === undefined || candidate.sdpMLineIndex === undefined && candidate.candidate === undefined) {
return;
}
if(this.peerConnection) {
await this.peerConnection.addIceCandidate(new RTCIceCandidate(candidate));
} else {
@@ -2199,9 +2202,6 @@ class Taoyao extends RemoteClient {
} else if (type === "answer") {
await session.peerConnection.setRemoteDescription(new RTCSessionDescription(message.body));
} else if (type === "candidate") {
if(!candidate || candidate.sdpMid === undefined || candidate.sdpMLineIndex === undefined && candidate.candidate === undefined) {
return;
}
await session.addIceCandidate(candidate);
} else {
}