refactoring

This commit is contained in:
Maxim Devaev
2022-11-29 10:13:53 +03:00
parent 6a339238ff
commit a68eb4ed2d
2 changed files with 25 additions and 30 deletions

View File

@@ -333,22 +333,18 @@ JanusStreamer.ensure_janus = function(callback) {
"debug": "all",
"callback": function() {
_Janus = module.Janus;
callback();
callback(true);
},
});
}).catch((err) => {
tools.error("Stream: Can't import Janus module:", err);
callback();
callback(false);
});
} else {
callback();
callback(true);
}
};
JanusStreamer.is_imported = function() {
return (_Janus !== null);
};
JanusStreamer.is_webrtc_available = function() {
return !!window.RTCPeerConnection;
};