Embed: unload webrtc player some more + fix for volume not being set to stored value in mews

This commit is contained in:
Cat 2021-06-09 15:02:16 +02:00 committed by Thulinma
parent 9d274fd64b
commit 35ea7edac4
4 changed files with 6 additions and 5 deletions

View file

@ -280,7 +280,7 @@ p.prototype.build = function (MistVideo,callback) {
if (callback) { callback(); }
};
thisWebRTCPlayer.peerConn.onconnectionstatechange = function(e){
if (this.destroyed) { return; } //the player doesn't exist any more
if (MistVideo.destroyed) { return; } //the player doesn't exist any more
switch (this.connectionState) {
case "failed": {
//WebRTC will never work (firewall maybe?)
@ -300,7 +300,7 @@ p.prototype.build = function (MistVideo,callback) {
}
};
thisWebRTCPlayer.peerConn.oniceconnectionstatechange = function(e){
if (this.destroyed) { return; } //the player doesn't exist any more
if (MistVideo.destroyed) { return; } //the player doesn't exist any more
switch (this.iceConnectionState) {
case "failed": {
MistVideo.showError("ICE connection "+this.iceConnectionState);
@ -726,6 +726,7 @@ p.prototype.build = function (MistVideo,callback) {
try {
me.webrtc.stop();
me.webrtc.signaling.ws.close();
me.webrtc.peerConn.close();
} catch (e) {}
};