= React.memo(
}
}
+ let noVideoNode: ReactNode;
+ let errorDialogTitle: ReactNode;
+ let errorDialogBody = '';
+ if (!hasVideoToShow) {
+ const showDialogButton = (
+
+ );
+ if (isBlocked) {
+ noVideoNode = (
+ <>
+
+ {showDialogButton}
+ >
+ );
+ errorDialogTitle = (
+
+ ,
+ }}
+ />
+
+ );
+ errorDialogBody = i18n('icu:calling__block-info');
+ } else if (showMissingMediaKeys) {
+ noVideoNode = (
+ <>
+
+
+ {i18n('icu:calling__missing-media-keys', { name: title })}
+
+ {showDialogButton}
+ >
+ );
+ errorDialogTitle = (
+
+ ,
+ }}
+ />
+
+ );
+ errorDialogBody = i18n('icu:calling__missing-media-keys-info');
+ } else {
+ noVideoNode = (
+
+ );
+ }
+ }
+
return (
<>
- {showBlockInfo && (
+ {showErrorDialog && (
{
- setShowBlockInfo(false);
- }}
- title={
-
- ,
- }}
- />
-
- }
+ onClose={() => setShowErrorDialog(false)}
+ theme={Theme.Dark}
+ title={errorDialogTitle}
>
- {i18n('icu:calling__block-info')}
+ {errorDialogBody}
)}
@@ -372,40 +447,12 @@ export const GroupCallRemoteParticipant: React.FC = React.memo(
}}
/>
)}
- {!hasVideoToShow && (
+ {noVideoNode && (
- {isBlocked ? (
- <>
-
-
- >
- ) : (
-
- )}
+ {noVideoNode}
)}
diff --git a/ts/services/calling.ts b/ts/services/calling.ts
index 923a7d9bd93a..18cf8f768589 100644
--- a/ts/services/calling.ts
+++ b/ts/services/calling.ts
@@ -1086,11 +1086,14 @@ export class CallingClass {
aci = '00000000-0000-4000-8000-000000000000';
}
assertDev(isAciString(aci), 'remote participant aci must be a aci');
+
return {
aci,
+ addedTime: normalizeGroupCallTimestamp(remoteDeviceState.addedTime),
demuxId: remoteDeviceState.demuxId,
hasRemoteAudio: !remoteDeviceState.audioMuted,
hasRemoteVideo: !remoteDeviceState.videoMuted,
+ mediaKeysReceived: remoteDeviceState.mediaKeysReceived,
presenting: Boolean(remoteDeviceState.presenting),
sharingScreen: Boolean(remoteDeviceState.sharingScreen),
speakerTime: normalizeGroupCallTimestamp(
diff --git a/ts/state/ducks/calling.ts b/ts/state/ducks/calling.ts
index 89f6f40bfa98..ab1fb90108ec 100644
--- a/ts/state/ducks/calling.ts
+++ b/ts/state/ducks/calling.ts
@@ -76,9 +76,11 @@ export type GroupCallPeekInfoType = ReadonlyDeep<{
// eslint-disable-next-line local-rules/type-alias-readonlydeep
export type GroupCallParticipantInfoType = {
aci: AciString;
+ addedTime?: number;
demuxId: number;
hasRemoteAudio: boolean;
hasRemoteVideo: boolean;
+ mediaKeysReceived: boolean;
presenting: boolean;
sharingScreen: boolean;
speakerTime?: number;
diff --git a/ts/state/smart/CallManager.tsx b/ts/state/smart/CallManager.tsx
index 4c55d1495384..147885f68bed 100644
--- a/ts/state/smart/CallManager.tsx
+++ b/ts/state/smart/CallManager.tsx
@@ -246,10 +246,12 @@ const mapStateToActiveCallProp = (
remoteParticipants.push({
...remoteConversation,
aci: remoteParticipant.aci,
+ addedTime: remoteParticipant.addedTime,
demuxId: remoteParticipant.demuxId,
hasRemoteAudio: remoteParticipant.hasRemoteAudio,
hasRemoteVideo: remoteParticipant.hasRemoteVideo,
isHandRaised: raisedHands.has(remoteParticipant.demuxId),
+ mediaKeysReceived: remoteParticipant.mediaKeysReceived,
presenting: remoteParticipant.presenting,
sharingScreen: remoteParticipant.sharingScreen,
speakerTime: remoteParticipant.speakerTime,
diff --git a/ts/test-electron/state/ducks/calling_test.ts b/ts/test-electron/state/ducks/calling_test.ts
index b2a43c9e99f4..55dae23ed0f9 100644
--- a/ts/test-electron/state/ducks/calling_test.ts
+++ b/ts/test-electron/state/ducks/calling_test.ts
@@ -118,6 +118,7 @@ describe('calling duck', () => {
demuxId: 123,
hasRemoteAudio: true,
hasRemoteVideo: true,
+ mediaKeysReceived: true,
presenting: false,
sharingScreen: false,
videoAspectRatio: 4 / 3,
@@ -906,6 +907,7 @@ describe('calling duck', () => {
demuxId: 123,
hasRemoteAudio: true,
hasRemoteVideo: true,
+ mediaKeysReceived: true,
presenting: false,
sharingScreen: false,
videoAspectRatio: 4 / 3,
@@ -935,6 +937,7 @@ describe('calling duck', () => {
demuxId: 123,
hasRemoteAudio: true,
hasRemoteVideo: true,
+ mediaKeysReceived: true,
presenting: false,
sharingScreen: false,
videoAspectRatio: 4 / 3,
@@ -966,6 +969,7 @@ describe('calling duck', () => {
demuxId: 456,
hasRemoteAudio: false,
hasRemoteVideo: true,
+ mediaKeysReceived: true,
presenting: false,
sharingScreen: false,
videoAspectRatio: 16 / 9,
@@ -993,6 +997,7 @@ describe('calling duck', () => {
demuxId: 456,
hasRemoteAudio: false,
hasRemoteVideo: true,
+ mediaKeysReceived: true,
presenting: false,
sharingScreen: false,
videoAspectRatio: 16 / 9,
@@ -1037,6 +1042,7 @@ describe('calling duck', () => {
demuxId: 456,
hasRemoteAudio: false,
hasRemoteVideo: true,
+ mediaKeysReceived: true,
presenting: false,
sharingScreen: false,
videoAspectRatio: 16 / 9,
@@ -1089,6 +1095,7 @@ describe('calling duck', () => {
demuxId: 456,
hasRemoteAudio: false,
hasRemoteVideo: true,
+ mediaKeysReceived: true,
presenting: false,
sharingScreen: false,
videoAspectRatio: 16 / 9,
@@ -1128,6 +1135,7 @@ describe('calling duck', () => {
demuxId: 456,
hasRemoteAudio: false,
hasRemoteVideo: true,
+ mediaKeysReceived: true,
presenting: false,
sharingScreen: false,
videoAspectRatio: 16 / 9,
@@ -1160,6 +1168,7 @@ describe('calling duck', () => {
demuxId: 456,
hasRemoteAudio: false,
hasRemoteVideo: true,
+ mediaKeysReceived: true,
presenting: false,
sharingScreen: false,
videoAspectRatio: 16 / 9,
@@ -1204,6 +1213,7 @@ describe('calling duck', () => {
demuxId: 456,
hasRemoteAudio: false,
hasRemoteVideo: true,
+ mediaKeysReceived: true,
presenting: false,
sharingScreen: false,
videoAspectRatio: 16 / 9,
@@ -1882,6 +1892,7 @@ describe('calling duck', () => {
demuxId: 123,
hasRemoteAudio: true,
hasRemoteVideo: true,
+ mediaKeysReceived: true,
presenting: false,
sharingScreen: false,
videoAspectRatio: 4 / 3,
@@ -1908,6 +1919,7 @@ describe('calling duck', () => {
demuxId: 123,
hasRemoteAudio: true,
hasRemoteVideo: true,
+ mediaKeysReceived: true,
presenting: false,
sharingScreen: false,
videoAspectRatio: 4 / 3,
@@ -1954,6 +1966,7 @@ describe('calling duck', () => {
demuxId: 123,
hasRemoteAudio: true,
hasRemoteVideo: true,
+ mediaKeysReceived: true,
presenting: false,
sharingScreen: false,
videoAspectRatio: 4 / 3,
@@ -2004,6 +2017,7 @@ describe('calling duck', () => {
demuxId: 123,
hasRemoteAudio: true,
hasRemoteVideo: true,
+ mediaKeysReceived: true,
presenting: false,
sharingScreen: false,
videoAspectRatio: 4 / 3,
@@ -2048,6 +2062,7 @@ describe('calling duck', () => {
demuxId: 123,
hasRemoteAudio: true,
hasRemoteVideo: true,
+ mediaKeysReceived: true,
presenting: false,
sharingScreen: false,
videoAspectRatio: 4 / 3,
diff --git a/ts/types/Calling.ts b/ts/types/Calling.ts
index b29da3b6e9bf..5aa89f3e3bd1 100644
--- a/ts/types/Calling.ts
+++ b/ts/types/Calling.ts
@@ -156,10 +156,12 @@ export enum GroupCallJoinState {
export type GroupCallRemoteParticipantType = ConversationType & {
aci: AciString;
+ addedTime?: number;
demuxId: number;
hasRemoteAudio: boolean;
hasRemoteVideo: boolean;
isHandRaised: boolean;
+ mediaKeysReceived: boolean;
presenting: boolean;
sharingScreen: boolean;
speakerTime?: number;