Skip to content

Commit

Permalink
webrtc: show error in case setRemoteDescription fails (#3416)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Jun 2, 2024
1 parent f4b7f14 commit 6da8aee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
16 changes: 10 additions & 6 deletions internal/servers/webrtc/publish_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,16 @@
pc.setRemoteDescription(new RTCSessionDescription({
type: 'answer',
sdp,
}));

if (queuedCandidates.length !== 0) {
sendLocalCandidates(queuedCandidates);
queuedCandidates = [];
}
}))
.then(() => {
if (queuedCandidates.length !== 0) {
sendLocalCandidates(queuedCandidates);
queuedCandidates = [];
}
})
.catch((err) => {
onError(err.toString());
});
};

const sendOffer = (offer) => {
Expand Down
16 changes: 10 additions & 6 deletions internal/servers/webrtc/read_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,16 @@
pc.setRemoteDescription(new RTCSessionDescription({
type: 'answer',
sdp,
}));

if (queuedCandidates.length !== 0) {
sendLocalCandidates(queuedCandidates);
queuedCandidates = [];
}
}))
.then(() => {
if (queuedCandidates.length !== 0) {
sendLocalCandidates(queuedCandidates);
queuedCandidates = [];
}
})
.catch((err) => {
onError(err.toString());
});
};

const sendOffer = (offer) => {
Expand Down

0 comments on commit 6da8aee

Please sign in to comment.