From 5e5038a398097d1506035e001742556037026a5e Mon Sep 17 00:00:00 2001 From: Piasy Date: Wed, 1 Apr 2020 21:01:29 +0800 Subject: [PATCH] expose channels (PC), allowing KITE test --- src/sdk/conference/client.js | 11 +++++++++-- src/sdk/p2p/p2pclient.js | 7 +++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/sdk/conference/client.js b/src/sdk/conference/client.js index cb20cef4..945175f1 100644 --- a/src/sdk/conference/client.js +++ b/src/sdk/conference/client.js @@ -321,8 +321,15 @@ export const ConferenceClient = function(config, signalingImpl) { if (!room) { return null; } - return new ConferenceInfo(room.id, Array.from(participants, (x) => x[ - 1]), Array.from(remoteStreams, (x) => x[1]), me); + return new ConferenceInfo(room.id, Array.from(participants + .values()), Array.from(remoteStreams.values()), me); + }, + }); + + Object.defineProperty(this, 'channels', { + configurable: false, + get: () => { + return Array.from(channels.values()); }, }); diff --git a/src/sdk/p2p/p2pclient.js b/src/sdk/p2p/p2pclient.js index bbc486a6..8f75f0f9 100644 --- a/src/sdk/p2p/p2pclient.js +++ b/src/sdk/p2p/p2pclient.js @@ -112,6 +112,13 @@ const P2PClient = function(configuration, signalingChannel) { self.dispatchEvent(new OwtEvent('serverdisconnected')); }; + Object.defineProperty(this, 'channels', { + configurable: false, + get: () => { + return Array.from(channels.values()); + }, + }); + /** * @member {array} allowedRemoteIds * @memberof Owt.P2P.P2PClient