Start voice call in PiP (not in fullscreen) (#34055)
* start voice call in pip
* Update jest.config.ts
* fix "join" button to use correct intent
* Add regression test for join button
* Update RoomHeader-test.tsx
* fmt
* Add playwright test
* Fix expected intent on "join" button press
* Add additional pip check to exising:
`should be able to join a ${callType} call in progress` test
* Update RoomHeader-test.tsx
This commit is contained in:
@@ -118,7 +118,7 @@ function RoomHeaderButtons({
|
||||
>
|
||||
<Button
|
||||
size="md"
|
||||
onClick={videoClick}
|
||||
onClick={activeCallSessionType === CallType.Video ? videoClick : voiceClick}
|
||||
// If we know this is a voice session, show the voice call. All other kinds of call are video calls.
|
||||
Icon={activeCallSessionType === CallType.Voice ? VoiceCallIcon : VideoCallIcon}
|
||||
className="mx_RoomHeader_join_button"
|
||||
|
||||
@@ -52,6 +52,7 @@ import { setMarkedUnreadState } from "../utils/notifications";
|
||||
import { ConnectionState, ElementCall } from "../models/Call";
|
||||
import { isVideoRoom } from "../utils/video-rooms";
|
||||
import { ModuleApi } from "../modules/Api";
|
||||
import ActiveWidgetStore from "./ActiveWidgetStore";
|
||||
|
||||
const NUM_JOIN_RETRY = 5;
|
||||
|
||||
@@ -377,6 +378,12 @@ export class RoomViewStore extends EventEmitter {
|
||||
ElementCall.create(room);
|
||||
call = CallStore.instance.getCall(payload.room_id)!;
|
||||
}
|
||||
|
||||
// Custom case where we start voice calls in pip
|
||||
if (payload.voiceOnly ?? false) {
|
||||
viewingCall = false;
|
||||
ActiveWidgetStore.instance.setWidgetPersistence(call.widget.id, room.roomId, true);
|
||||
}
|
||||
call.presented = true;
|
||||
// Immediately start the call. This will connect to all required widget events
|
||||
// and allow the widget to show the lobby.
|
||||
@@ -401,7 +408,7 @@ export class RoomViewStore extends EventEmitter {
|
||||
roomLoadError: null,
|
||||
viaServers: payload.via_servers,
|
||||
wasContextSwitch: payload.context_switch,
|
||||
viewingCall: payload.view_call ?? false,
|
||||
viewingCall,
|
||||
});
|
||||
// set this room as the room subscription. We need to await for it as this will fetch
|
||||
// all room state for this room, which is required before we get the state below.
|
||||
|
||||
Reference in New Issue
Block a user