From fccd21eefd4bc0fc8ceae482eb5a62a40a27e40e Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Wed, 26 May 2021 13:03:10 +0200 Subject: [PATCH] openvidu-browser: OpenVidu#getWsReadyState --- openvidu-browser/src/OpenVidu/OpenVidu.ts | 7 +++++++ .../KurentoUtils/kurento-jsonrpc/clients/jsonrpcclient.js | 4 ++++ .../clients/transports/webSocketWithReconnection.js | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/openvidu-browser/src/OpenVidu/OpenVidu.ts b/openvidu-browser/src/OpenVidu/OpenVidu.ts index 67b02967..c9710b17 100644 --- a/openvidu-browser/src/OpenVidu/OpenVidu.ts +++ b/openvidu-browser/src/OpenVidu/OpenVidu.ts @@ -780,6 +780,13 @@ export class OpenVidu { this.jsonRpcClient.close(4103, "Master Node has crashed"); } + /** + * @hidden + */ + getWsReadyState(): number { + return this.jsonRpcClient.getReadyState(); + } + /** * @hidden */ diff --git a/openvidu-browser/src/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/jsonrpcclient.js b/openvidu-browser/src/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/jsonrpcclient.js index 9a626f05..8f0463ca 100644 --- a/openvidu-browser/src/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/jsonrpcclient.js +++ b/openvidu-browser/src/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/jsonrpcclient.js @@ -270,6 +270,10 @@ function JsonRpcClient(configuration) { pingNextNum = 0; usePing(); } + + this.getReadyState = function () { + return ws.getReadyState(); + } } diff --git a/openvidu-browser/src/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/transports/webSocketWithReconnection.js b/openvidu-browser/src/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/transports/webSocketWithReconnection.js index 91045c99..4850077f 100644 --- a/openvidu-browser/src/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/transports/webSocketWithReconnection.js +++ b/openvidu-browser/src/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/transports/webSocketWithReconnection.js @@ -151,6 +151,10 @@ function WebSocketWithReconnection(config) { }; registerMessageHandler(); }; + + this.getReadyState = () => { + return ws.readyState; + } } module.exports = WebSocketWithReconnection; \ No newline at end of file