-
-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable group calls without video and audio track by configuration of MatrixClient #3162
Enable group calls without video and audio track by configuration of MatrixClient #3162
Conversation
src/webrtc/groupCall.ts
Outdated
} | ||
|
||
public set initCallWithoutVideoAndAudio(allowCallWithOutVideoAndAudio: boolean) { | ||
this.allowCallWithOutVideoAndAudio = allowCallWithOutVideoAndAudio; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not put this into opts and make it readonly and public?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the beginning createGroupCall
from the MatrixClient stopped me from doing that. But since the configuration is now done via the Matrix Client, there is no reason not to do it via the constructor. Thx 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not exactly confident having this as a flag on the client is the correct way to go though I can't think of alternatives 🤔 Could we quickly go over this in the EC internal room?
src/webrtc/groupCall.ts
Outdated
// Because we need a Local Call Feed to establish a call connection, we avoid muting video in case of empty | ||
// video track. In this way we go sure if a client implements muting we don't raise an error. | ||
if (this.initCallWithoutVideoAndAudio && this.localCallFeed?.stream.getVideoTracks().length === 0) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it's somehow not clear to me what this piece of code does exactly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My implementation allows feeds that does not contain tracks at all. I have to make sure that the user of the SDK doesn't try to mute a feed that doesn't have a video track. This case must be caught. It would be logically correct if we would have no LocalFeed. This case is covert below. But you need a LocalFeed to innit a GroupCall. I can't go the way of PTT either, because I have to assume that no device exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to check for this.initCallWithoutVideoAndAudio
? Wouldn't it always be an error to try & mute/unmute video if there was no video track?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'll remove it
Technically we could implement a new GroupCall Type in the same way we do this with PTT. After this we can bind it on EC internal room like we do it currently with PTT. However, I don't think that's a good idea. The SDK is based on Feeds with a video and a audio track. PTT is already working around this and provide Feeds with only audio tracks. The feature I'm implemented should allows calls without Feeds at all. I'am working around this in a way thats I am provide Feeds without audio and without video tracks (but this is not a Feed anymore). However this is a hack, because a User is connected in the call, when we receive a Feed from the user means a Video or Audio Track from him. As long as we don't know exactly what is a Feed and what isn't, it's better to configure this feature separately via the client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think basically either we add this flag (which does make the logic of calls a bit more complex) or accept that it's no longer an error condition to have a call with no local or remote feeds (ie. basically just make this behaviour the default. I think making it the default could be okay actually: it would be an API change (albeit not a very significant one) but I think that's OK?
src/webrtc/groupCall.ts
Outdated
// Because we need a Local Call Feed to establish a call connection, we avoid muting video in case of empty | ||
// video track. In this way we go sure if a client implements muting we don't raise an error. | ||
if (this.initCallWithoutVideoAndAudio && this.localCallFeed?.stream.getVideoTracks().length === 0) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to check for this.initCallWithoutVideoAndAudio
? Wouldn't it always be an error to try & mute/unmute video if there was no video track?
I didn't want to change that much and I wanted to keep it very simple, so we can close the ticket (only screen share calls) This implementation works because no feed is expected if flag active. I have no idea how complicated it will be to add a new GrupenCall type. |
Agreed, I don't think adding a new group call type is the way to go. I feel okay about the flag since it leaves 1:1 calls in element web etc in a mode where the call will fail if no media is negotiated, which is probably the sensible thing to do. Perhaps we could put the option either in |
Yeah, that sounds good |
And because it change the behavior of the SDK its a good idea to path it by constructor, we already have discussed |
Maybe the name @dbkr @SimonBrandner could you agree about it? |
3775e7f
to
9880a2e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the code in groupcall.ts
be simplified now?
@SimonBrandner Can you please be more specific? Do you mean |
@dbkr PTAL |
…all-without-video-and-audio
Apologies for jumping the queue with #3184 - the develop branch was broken due to me force-merging a PR that broke our quality guidelines (because it contained repeated code, to allow us to migrate smoothly from an old to new interface without breaking matrix-react-sdk). The PR I jumped to the front of the queue should unbreak us, meaning this PR can get merged when it gets to the front of the queue. |
Due to a required parameter being added |
#3186 brought back backwards compatibility - thanks @EnricoSchw |
* Implement MSC3758: a push rule condition to match event properties exactly ([\matrix-org#3179](matrix-org#3179)). * Enable group calls without video and audio track by configuration of MatrixClient ([\matrix-org#3162](matrix-org#3162)). Contributed by @EnricoSchw. * Updates to protocol used for Sign in with QR code ([\matrix-org#3155](matrix-org#3155)). Contributed by @hughns. * Implement MSC3873 to handle escaped dots in push rule keys ([\matrix-org#3134](matrix-org#3134)). Fixes undefined/matrix-js-sdk#1454. * Fix spec compliance issue around encrypted `m.relates_to` ([\matrix-org#3178](matrix-org#3178)). * Fix reactions in threads sometimes causing stuck notifications ([\matrix-org#3146](matrix-org#3146)). Fixes element-hq/element-web#24000. Contributed by @justjanne.
Checklist
Allow Element Call to be started without audio / video interface for the sake of a screen-sharing only session element-hq/element-call#902
Here's what your changelog entry will look like:
✨ Features