mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-17 16:50:31 +00:00
Disable renegotiation when ICE fails
This commit is contained in:
parent
bc17b1c2a0
commit
d9a13f006c
1 changed files with 4 additions and 0 deletions
|
|
@ -203,6 +203,8 @@ export const webrtc = {
|
|||
) => {
|
||||
log.debug("[rtc] [sdp] remote SDP", sdp);
|
||||
|
||||
if (!pc) return;
|
||||
|
||||
try {
|
||||
await pc.setRemoteDescription(new RTCSessionDescription(sdp));
|
||||
} catch (e) {
|
||||
|
|
@ -230,6 +232,8 @@ export const webrtc = {
|
|||
addCandidate: (
|
||||
/** @type {RTCLocalIceCandidateInit | string} */ candidate,
|
||||
) => {
|
||||
if (!pc) return;
|
||||
|
||||
if (hasRemoteDescription()) {
|
||||
addRemoteCandidate(candidate);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue