Start voice call in PiP (not in fullscreen)#34055
Conversation
Half-Shot
left a comment
There was a problem hiding this comment.
A playwright test would be lovely if you could find some time for it. We should have some examples already.
| expect(dispatcherSpy).toHaveBeenCalledWith(expect.objectContaining({ view_call: true, voiceOnly: false })); | ||
| }); | ||
|
|
||
| it("clicking the join button of an ongoing voice call joins as a voice call", async () => { |
There was a problem hiding this comment.
Can't tell, is this testing the PiP bit?
There was a problem hiding this comment.
Not really. Its a regression test for a bug that surfaced working on this PR.
Let me document this in the PR description.
This PR surfaced an existing bug:
- pressing the join button on an ongoing call SHOULD either start a voice or a video call (the user cannot choose manually anymore) based on the intent of the current call (what others do). So that the new joiner has the correct camera preset.
- This was NOT the case. It always started a video call when pressing join.
- This change surfaces this as pressing join -> starts a video call -> does not start in pip.
- This was fixed and a regression tests added.
Half-Shot
left a comment
There was a problem hiding this comment.
Probably would still prefer the two changes you factored out to be merged first (and not in this PR :P), but the changes look good to me.
Both of the factored out changes have been merged in seperate PR's now: So the diff of this PR does not include the changes anymore (now, that I updated the branch.) |
`should be able to join a ${callType} call in progress` test
|
@Half-Shot I also added the pip container check to the existing: |
986e495 to
a966fa8
Compare
|
(provoking the cla tool into running :/) |
robintown
left a comment
There was a problem hiding this comment.
Skimmed this so far and it raised the following questions for me:
| call = CallStore.instance.getCall(payload.room_id)!; | ||
| } | ||
|
|
||
| // Custom case where we start voice calls in pip |
There was a problem hiding this comment.
Does this change apply to both placing a call and receiving a call?
| // Custom case where we start voice calls in pip | ||
| if (payload.voiceOnly ?? false) { | ||
| viewingCall = false; | ||
| ActiveWidgetStore.instance.setWidgetPersistence(call.widget.id, room.roomId, true); |
There was a problem hiding this comment.
Are you sure that eagerly setting the widget persistence to true before it's even loaded won't create new stuck widget issues? (Imagine the widget fails to load or instantly hits an error screen, for example)
There was a problem hiding this comment.
This is interesting.
I played around with it. Those are my observations:
- if you provide sth that does not speak widget api properly (random / broken url/ no network) you will not get
contentLoaded-> infinite loading spinnger- we currenlty do NOT have a timeout in EW. Just in the widget api. There we log:
Widget specified waitForIframeLoad=false but timed out waiting for contentLoaded event - Before this change: we could press the
xbutton and it would kill the widget. Or we switch room and the non sticky widget would get killed. - With this change it is sticky already. We will still see the "widget" (in loading state) when switching rooms. with the back button we can get into fullscreen and then press the
xbutton (the x will be there until we are connected to the call, its not based on the widget being sticky) the x button will take care of unsticking the widget.
- we currenlty do NOT have a timeout in EW. Just in the widget api. There we log:
- if a call crashes during load we can do the same work around as above.
TLDR:
- this is not an issue -> workaround: back button ->
xbutton - We dont have any EW timeout for widget loading to autoclose. User has to take action. This is an independent issue.
There was a problem hiding this comment.
I think the back button in the header is required to close broken calls.
The white background will become a follow up PR.
We might also want a voice call to be fullscreen:
- switch to video
- go to EC settings
With the back button in the header we need the space anyways and i think it might make sense to add the name there in that case.
What does design/product think about this?
@americanrefugee @daniellekirkwood

Fixes: https://github.com/element-hq/voip-internal/issues/608
For the reviewer:


Pressing the expand button in the call toast will get you to the lobby.
This seems undesired. We can either fix this as part of this PR or move this problem to when we adopt a new toast layout/ design.
This PR surfaced an existing bug:
Checklist
public/exportedsymbols have accurate TSDoc documentation.