Embed: Added websocket timeouts (stream info, mews, webrtc)

This commit is contained in:
Cat 2021-09-09 12:38:22 +02:00 committed by Thulinma
parent 854315afdd
commit f4fd56f170
6 changed files with 36 additions and 4 deletions

View file

@ -406,6 +406,13 @@ p.prototype.build = function (MistVideo,callback) {
});
}
};
this.ws.timeOut = MistVideo.timers.start(function(){
if (player.ws.readyState == 0) {
MistVideo.log("MP4 over WS: socket timeout - try next combo");
MistVideo.nextCombo();
}
},5e3);
this.ws.listeners = {}; //kind of event listener list for websocket messages
this.ws.addListener = function(type,f){
if (!(type in this.listeners)) { this.listeners[type] = []; }

View file

@ -435,6 +435,14 @@ p.prototype.build = function (MistVideo,callback) {
this.ws.onopen = function() {
onEvent({type: "on_connected"});
};
this.ws.timeOut = MistVideo.timers.start(function(){
if (MistVideo.player.webrtc.signaling.ws.readyState == 0) {
MistVideo.log("WebRTC: socket timeout - try next combo");
MistVideo.nextCombo();
}
},5e3);
this.ws.onmessage = function(e) {
try {