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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1053,7 +1053,7 @@ MistSkins["default"] = {
},button); },button);
//apply initial video state //apply initial video state
var initevent = MistUtil.event.addListener(video,"loadstart",function(){ var initevent = MistUtil.event.addListener(video,"loadedmetadata",function(){
if (('localStorage' in window) && (localStorage != null) && ('mistVolume' in localStorage)) { if (('localStorage' in window) && (localStorage != null) && ('mistVolume' in localStorage)) {
MistVideo.player.api.volume = localStorage['mistVolume']; MistVideo.player.api.volume = localStorage['mistVolume'];
} }

View file

@ -280,7 +280,7 @@ p.prototype.build = function (MistVideo,callback) {
if (callback) { callback(); } if (callback) { callback(); }
}; };
thisWebRTCPlayer.peerConn.onconnectionstatechange = function(e){ 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) { switch (this.connectionState) {
case "failed": { case "failed": {
//WebRTC will never work (firewall maybe?) //WebRTC will never work (firewall maybe?)
@ -300,7 +300,7 @@ p.prototype.build = function (MistVideo,callback) {
} }
}; };
thisWebRTCPlayer.peerConn.oniceconnectionstatechange = function(e){ 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) { switch (this.iceConnectionState) {
case "failed": { case "failed": {
MistVideo.showError("ICE connection "+this.iceConnectionState); MistVideo.showError("ICE connection "+this.iceConnectionState);
@ -726,6 +726,7 @@ p.prototype.build = function (MistVideo,callback) {
try { try {
me.webrtc.stop(); me.webrtc.stop();
me.webrtc.signaling.ws.close(); me.webrtc.signaling.ws.close();
me.webrtc.peerConn.close();
} catch (e) {} } catch (e) {}
}; };