forked from External/mediamtx
webrtc: show error in case setRemoteDescription fails (#3416)
This commit is contained in:
parent
f4b7f147a5
commit
6da8aee64f
2 changed files with 20 additions and 12 deletions
|
|
@ -443,12 +443,16 @@ const onRemoteAnswer = (sdp) => {
|
||||||
pc.setRemoteDescription(new RTCSessionDescription({
|
pc.setRemoteDescription(new RTCSessionDescription({
|
||||||
type: 'answer',
|
type: 'answer',
|
||||||
sdp,
|
sdp,
|
||||||
}));
|
}))
|
||||||
|
.then(() => {
|
||||||
if (queuedCandidates.length !== 0) {
|
if (queuedCandidates.length !== 0) {
|
||||||
sendLocalCandidates(queuedCandidates);
|
sendLocalCandidates(queuedCandidates);
|
||||||
queuedCandidates = [];
|
queuedCandidates = [];
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
onError(err.toString());
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const sendOffer = (offer) => {
|
const sendOffer = (offer) => {
|
||||||
|
|
|
||||||
|
|
@ -254,12 +254,16 @@ const onRemoteAnswer = (sdp) => {
|
||||||
pc.setRemoteDescription(new RTCSessionDescription({
|
pc.setRemoteDescription(new RTCSessionDescription({
|
||||||
type: 'answer',
|
type: 'answer',
|
||||||
sdp,
|
sdp,
|
||||||
}));
|
}))
|
||||||
|
.then(() => {
|
||||||
if (queuedCandidates.length !== 0) {
|
if (queuedCandidates.length !== 0) {
|
||||||
sendLocalCandidates(queuedCandidates);
|
sendLocalCandidates(queuedCandidates);
|
||||||
queuedCandidates = [];
|
queuedCandidates = [];
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
onError(err.toString());
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const sendOffer = (offer) => {
|
const sendOffer = (offer) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue