From e11c523a750366c33e814b59a400364926021d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Tue, 27 Apr 2021 10:06:21 +0200 Subject: [PATCH] Add getLocalFeeds() and getRemoteFeeds() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/webrtc/call.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/webrtc/call.ts b/src/webrtc/call.ts index 6602bc840..c966e5738 100644 --- a/src/webrtc/call.ts +++ b/src/webrtc/call.ts @@ -419,6 +419,22 @@ export class MatrixCall extends EventEmitter { return this.feeds; } + /** + * Returns an array of all local CallFeeds + * @returns {Array} local CallFeeds + */ + public getLocalFeeds(): Array { + return this.feeds.filter((feed) => {return feed.isLocal()}); + } + + /** + * Returns an array of all remote CallFeeds + * @returns {Array} remote CallFeeds + */ + public getRemoteFeeds(): Array { + return this.feeds.filter((feed) => {return !feed.isLocal()}); + } + /** * Returns true if there are no incoming feeds, * otherwise returns false