1
0
Fork 0
forked from External/mediamtx

webrtc: show error in case setRemoteDescription fails (#3416)

This commit is contained in:
Alessandro Ros 2024-06-02 22:14:36 +02:00 committed by GitHub
parent f4b7f147a5
commit 6da8aee64f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 12 deletions

View file

@ -443,12 +443,16 @@ const onRemoteAnswer = (sdp) => {
pc.setRemoteDescription(new RTCSessionDescription({
type: 'answer',
sdp,
}));
}))
.then(() => {
if (queuedCandidates.length !== 0) {
sendLocalCandidates(queuedCandidates);
queuedCandidates = [];
}
})
.catch((err) => {
onError(err.toString());
});
};
const sendOffer = (offer) => {

View file

@ -254,12 +254,16 @@ const onRemoteAnswer = (sdp) => {
pc.setRemoteDescription(new RTCSessionDescription({
type: 'answer',
sdp,
}));
}))
.then(() => {
if (queuedCandidates.length !== 0) {
sendLocalCandidates(queuedCandidates);
queuedCandidates = [];
}
})
.catch((err) => {
onError(err.toString());
});
};
const sendOffer = (offer) => {