-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
Group Calls (WIP) #1902
Group Calls (WIP) #1902
Conversation
src/webrtc/groupCall.ts
Outdated
} | ||
|
||
const CONF_ROOM = "me.robertlong.conf"; | ||
const CONF_PARTICIPANT = "me.robertlong.conf.participant"; |
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.
TODO: I need to move this to the proper MSC event once we've created it.
src/webrtc/groupCall.ts
Outdated
*/ | ||
|
||
// TODO: move this elsewhere or get rid of the retry logic. Do we need it? | ||
sendStateEventWithRetry( |
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 don't actually know that we still want this for this PR. I don't think it was actually making calls any more stable, but I don't know for sure.
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.
Generally, this looking absolutely awesome! I'll do a more thorough review when this isn't a draft but I've got a few more general points:
- It might be beneficial for
localParticipant
to be a getter the same waylocalUserMediaStream
and similar are -
GroupCall
should emitfeeds_changed
events and have agetFeeds()
method which is more friendly for makingCallView
components. It might even allow us to make the already existingCallView
in thereact-sdk
work without many changes - The TypeScript could be improved a bit (params and return types)
-
MediaHandler
from ImproveMatrixCall
media handling and internally removeCallType
s #1911 should be somehow used when it gets merged
@@ -630,6 +630,11 @@ export class MatrixCall extends EventEmitter { | |||
* @param {boolean} addToPeerConnection whether to add the tracks to the peer connection | |||
*/ | |||
public pushLocalFeed(callFeed: CallFeed, addToPeerConnection = true): void { | |||
if (this.feeds.some((feed) => callFeed.stream.id === feed.stream.id)) { |
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.
Does the same stream id always mean the same feed?
No particular reason to worry about old user agents here
Seems chrome at least will give you a disabled audio track if you already had another user media audio track and disabled it, so make sure our tracks are enabled when we add them. We already did this on one code path but it didn't get moved over when a new code path was added. On the plus side, we now know the reason for the ancient code that had the comment asking what it was for, so update that.
If a renogotiation ends up with one track being removed, we removed the whole stream, which would cause us to lose, for example, audio rather than just video.
* Add PTT call mode & mute by default in PTT calls (#2311) No other parts of PTT calls implemented yet * Make the tests pass again (#2316) 3280394 made call use a bunch of methods that weren't mocked in the tests. * Add maximum trasmit time for PTT (#2312) on sender side by muting mic after the max transmit time has elapsed. * Don't allow user to unmute if another user is speaking (#2313) * Add maximum trasmit time for PTT on sender side by muting mic after the max transmit time has elapsed. * Don't allow user to unmute if another user is speaking Based on #2312 For element-hq/element-call#298 * Fix createGroupCall arguments (#2325) Comma instead of a colon...
Closing in favour of #2355 |
Group Calls
This PR expands upon Matrix calls and adds support for establishing calls to multiple members in a room. The code stems from my work on matrix-video-chat.
New Classes
GroupCall
Created by calling
client.createGroupCall(roomId, type)
where type can be either"voice"
or"video"
. This class essentially sets up a bunch ofMatrixCall
s to room members who have set a participant state event.GroupCallParticipant
This is a wrapper around
MatrixCall
that represents the state for a participant who has entered aGroupCall
.New Features
Addition of the
invitee
field tom.call.invite
This
invitee
field allows the recipients of them.call.invite
event to filter out invites not intended for them.Ice Disconnected Timeout
Rather than wait on the Ice
failed
connection state, I added a 30 second timeout which ensures that calls hang up if you've been disconnected for too long. If the connection state changes within this 30 second period, this timeout resets.Active Speaker
@SimonBrandner recently added speaking and volume events to
CallFeed
s, this PR uses that work to track the "active speaker" in a group call. This is primarily intended to be used to show what user should be focused in a group call.WebRTC Datachannels
Adding datachannels to calls is currently possible by calling
call.peerConn.createDataChannel()
. This PR just formalizes that process by adding a public API method for doing so and adatachannel
event for listening for new datachannels on aMatrixCall
orGroupCall
.To Do:
getLocalAudioStream
/getLocalVideoStream
CallFeed
exportinvitee
field.This PR currently has no changelog labels, so will not be included in changelogs.
A reviewer can add one of:
T-Deprecation
,T-Enhancement
,T-Defect
,T-Task
to indicate what type of change this is, or addType: [enhancement/defect/task]
to the description and I'll add them for you.