Avoid calling screenshare viewer exit twice and handle any possible exception
This commit is contained in:
parent
3fa8c1c7b6
commit
e327625b64
@ -108,15 +108,11 @@ KurentoManager.prototype.exitScreenShare = function () {
|
||||
this.kurentoScreenshare.dispose();
|
||||
this.kurentoScreenshare = null;
|
||||
}
|
||||
|
||||
if (typeof this.kurentoVideo !== 'undefined' && this.kurentoVideo) {
|
||||
this.exitVideo();
|
||||
}
|
||||
};
|
||||
|
||||
KurentoManager.prototype.exitVideo = function () {
|
||||
try {
|
||||
if (typeof this.kurentoVideo !== 'undefined' && this.kurentoVideo) {
|
||||
|
||||
if(this.kurentoVideo.webRtcPeer) {
|
||||
this.kurentoVideo.webRtcPeer.peerConnection.oniceconnectionstatechange = null;
|
||||
}
|
||||
@ -137,6 +133,13 @@ KurentoManager.prototype.exitVideo = function () {
|
||||
this.kurentoVideo.dispose();
|
||||
this.kurentoVideo = null;
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
if (this.kurentoVideo) {
|
||||
this.kurentoVideo.dispose();
|
||||
this.kurentoVideo = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
KurentoManager.prototype.exitAudio = function () {
|
||||
|
Loading…
Reference in New Issue
Block a user