@webex/plugin-meetings 3.8.1-next.3 → 3.8.1-next.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +26 -13
  2. package/dist/breakouts/breakout.js +1 -1
  3. package/dist/breakouts/index.js +1 -1
  4. package/dist/constants.js +21 -2
  5. package/dist/constants.js.map +1 -1
  6. package/dist/interpretation/index.js +1 -1
  7. package/dist/interpretation/siLanguage.js +1 -1
  8. package/dist/locus-info/index.js +36 -17
  9. package/dist/locus-info/index.js.map +1 -1
  10. package/dist/media/index.js +2 -2
  11. package/dist/media/index.js.map +1 -1
  12. package/dist/meeting/brbState.js +14 -12
  13. package/dist/meeting/brbState.js.map +1 -1
  14. package/dist/meeting/index.js +169 -66
  15. package/dist/meeting/index.js.map +1 -1
  16. package/dist/meeting/request.js +19 -0
  17. package/dist/meeting/request.js.map +1 -1
  18. package/dist/meeting/request.type.js.map +1 -1
  19. package/dist/meetings/index.js +35 -33
  20. package/dist/meetings/index.js.map +1 -1
  21. package/dist/members/index.js +8 -6
  22. package/dist/members/index.js.map +1 -1
  23. package/dist/members/request.js +3 -3
  24. package/dist/members/request.js.map +1 -1
  25. package/dist/members/util.js +18 -6
  26. package/dist/members/util.js.map +1 -1
  27. package/dist/multistream/mediaRequestManager.js +1 -1
  28. package/dist/multistream/mediaRequestManager.js.map +1 -1
  29. package/dist/multistream/remoteMedia.js +34 -5
  30. package/dist/multistream/remoteMedia.js.map +1 -1
  31. package/dist/multistream/remoteMediaGroup.js +42 -2
  32. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  33. package/dist/multistream/sendSlotManager.js +32 -2
  34. package/dist/multistream/sendSlotManager.js.map +1 -1
  35. package/dist/reachability/index.js +5 -10
  36. package/dist/reachability/index.js.map +1 -1
  37. package/dist/types/constants.d.ts +19 -0
  38. package/dist/types/meeting/brbState.d.ts +0 -1
  39. package/dist/types/meeting/index.d.ts +28 -4
  40. package/dist/types/meeting/request.d.ts +9 -1
  41. package/dist/types/meeting/request.type.d.ts +74 -0
  42. package/dist/types/members/index.d.ts +8 -3
  43. package/dist/types/members/request.d.ts +1 -1
  44. package/dist/types/members/util.d.ts +5 -2
  45. package/dist/types/multistream/remoteMedia.d.ts +20 -1
  46. package/dist/types/multistream/remoteMediaGroup.d.ts +11 -0
  47. package/dist/types/multistream/sendSlotManager.d.ts +16 -0
  48. package/dist/types/reachability/index.d.ts +2 -2
  49. package/dist/webinar/index.js +1 -1
  50. package/package.json +24 -24
  51. package/src/constants.ts +20 -0
  52. package/src/locus-info/index.ts +47 -20
  53. package/src/media/index.ts +2 -2
  54. package/src/meeting/brbState.ts +9 -7
  55. package/src/meeting/index.ts +126 -23
  56. package/src/meeting/request.ts +16 -0
  57. package/src/meeting/request.type.ts +64 -0
  58. package/src/meetings/index.ts +3 -2
  59. package/src/members/index.ts +7 -5
  60. package/src/members/request.ts +2 -2
  61. package/src/members/util.ts +14 -3
  62. package/src/multistream/mediaRequestManager.ts +7 -7
  63. package/src/multistream/remoteMedia.ts +34 -4
  64. package/src/multistream/remoteMediaGroup.ts +37 -2
  65. package/src/multistream/sendSlotManager.ts +34 -2
  66. package/src/reachability/index.ts +5 -13
  67. package/test/unit/spec/locus-info/index.js +177 -47
  68. package/test/unit/spec/media/index.ts +107 -0
  69. package/test/unit/spec/meeting/brbState.ts +9 -9
  70. package/test/unit/spec/meeting/index.js +606 -55
  71. package/test/unit/spec/meeting/request.js +71 -0
  72. package/test/unit/spec/meetings/index.js +1 -0
  73. package/test/unit/spec/members/index.js +32 -9
  74. package/test/unit/spec/members/request.js +2 -2
  75. package/test/unit/spec/members/utils.js +27 -7
  76. package/test/unit/spec/multistream/mediaRequestManager.ts +19 -6
  77. package/test/unit/spec/multistream/remoteMedia.ts +66 -2
  78. package/test/unit/spec/multistream/sendSlotManager.ts +59 -0
  79. package/test/unit/spec/reachability/index.ts +2 -6
@@ -121,6 +121,7 @@ import {
121
121
  WEBINAR_ERROR_REGISTRATION_ID,
122
122
  JOIN_BEFORE_HOST,
123
123
  REGISTRATION_ID_STATUS,
124
+ STAGE_MANAGER_TYPE,
124
125
  } from '../constants';
125
126
  import BEHAVIORAL_METRICS from '../metrics/constants';
126
127
  import ParameterError from '../common/errors/parameter';
@@ -164,6 +165,7 @@ import {BrbState, createBrbState} from './brbState';
164
165
  import MultistreamNotSupportedError from '../common/errors/multistream-not-supported-error';
165
166
  import JoinForbiddenError from '../common/errors/join-forbidden-error';
166
167
  import {ReachabilityMetrics} from '../reachability/reachability.types';
168
+ import {SetStageOptions, SetStageVideoLayout, UnsetStageVideoLayout} from './request.type';
167
169
 
168
170
  // default callback so we don't call an undefined function, but in practice it should never be used
169
171
  const DEFAULT_ICE_PHASE_CALLBACK = () => 'JOIN_MEETING_FINAL';
@@ -231,6 +233,14 @@ export type AddMediaOptions = {
231
233
  remoteMediaManagerConfig?: RemoteMediaManagerConfiguration; // applies only to multistream meetings
232
234
  bundlePolicy?: BundlePolicy; // applies only to multistream meetings
233
235
  allowMediaInLobby?: boolean; // allows adding media when in the lobby
236
+ additionalMediaOptions?: AdditionalMediaOptions; // allows adding additional options like send/receive audio/video
237
+ };
238
+
239
+ export type AdditionalMediaOptions = {
240
+ sendVideo?: boolean; // if not specified, default value of videoEnabled is used
241
+ receiveVideo?: boolean; // if not specified, default value of videoEnabled is used
242
+ sendAudio?: boolean; // if not specified, default value of audioEnabled true is used
243
+ receiveAudio?: boolean; // if not specified, default value of audioEnabled true is used
234
244
  };
235
245
 
236
246
  export type CallStateForMetrics = {
@@ -263,8 +273,9 @@ type FetchMeetingInfoParams = {
263
273
  };
264
274
 
265
275
  type MediaReachabilityMetrics = ReachabilityMetrics & {
266
- isSubnetReachable: boolean;
267
- selectedCluster: string | null;
276
+ subnet_reachable: boolean;
277
+ selected_cluster: string | null;
278
+ selected_subnet: string | null;
268
279
  };
269
280
 
270
281
  /**
@@ -732,10 +743,11 @@ export default class Meeting extends StatelessWebexPlugin {
732
743
  /**
733
744
  * @param {Object} attrs
734
745
  * @param {Object} options
746
+ * @param {Function} callback - if provided, it will be called with the newly created meeting object as soon as the meeting.id is set
735
747
  * @constructor
736
748
  * @memberof Meeting
737
749
  */
738
- constructor(attrs: any, options: object) {
750
+ constructor(attrs: any, options: object, callback: (meeting: Meeting) => void) {
739
751
  super({}, options);
740
752
  /**
741
753
  * @instance
@@ -761,6 +773,11 @@ export default class Meeting extends StatelessWebexPlugin {
761
773
  * @memberof Meeting
762
774
  */
763
775
  this.id = uuid.v4();
776
+
777
+ if (callback) {
778
+ callback(this);
779
+ }
780
+
764
781
  /**
765
782
  * Call state used for metrics
766
783
  * @instance
@@ -2757,9 +2774,11 @@ export default class Meeting extends StatelessWebexPlugin {
2757
2774
  LOCUSINFO.EVENTS.CONTROLS_MEETING_TRANSCRIPTION_SPOKEN_LANGUAGE_UPDATED,
2758
2775
  ({spokenLanguage}) => {
2759
2776
  if (spokenLanguage) {
2760
- this.transcription.languageOptions.currentSpokenLanguage = spokenLanguage;
2777
+ if (this.transcription?.languageOptions) {
2778
+ this.transcription.languageOptions.currentSpokenLanguage = spokenLanguage;
2779
+ }
2761
2780
  // @ts-ignore
2762
- this.webex.internal.voicea.onSpokenLanguageUpdate(spokenLanguage);
2781
+ this.webex.internal.voicea.onSpokenLanguageUpdate(spokenLanguage, this.id);
2763
2782
 
2764
2783
  Trigger.trigger(
2765
2784
  this,
@@ -2768,7 +2787,7 @@ export default class Meeting extends StatelessWebexPlugin {
2768
2787
  function: 'setupLocusControlsListener',
2769
2788
  },
2770
2789
  EVENT_TRIGGERS.MEETING_TRANSCRIPTION_SPOKEN_LANGUAGE_UPDATED,
2771
- {spokenLanguage}
2790
+ {spokenLanguage, meetingId: this.id}
2772
2791
  );
2773
2792
  }
2774
2793
  }
@@ -3850,15 +3869,16 @@ export default class Meeting extends StatelessWebexPlugin {
3850
3869
  }
3851
3870
 
3852
3871
  /**
3853
- * Cancel an SIP call invitation made during a meeting
3872
+ * Cancel an SIP/phone call invitation made during a meeting
3854
3873
  * @param {Object} invitee
3855
3874
  * @param {String} invitee.memberId
3856
- * @returns {Promise} see #members.cancelSIPInvite
3875
+ * @param {Boolean} [invitee.isInternalNumber] - When cancel phone invitation, if the number is internal
3876
+ * @returns {Promise} see #members.cancelInviteByMemberId
3857
3877
  * @public
3858
3878
  * @memberof Meeting
3859
3879
  */
3860
- public cancelSIPInvite(invitee: {memberId: string}) {
3861
- return this.members.cancelSIPInvite(invitee);
3880
+ public cancelInviteByMemberId(invitee: {memberId: string; isInternalNumber?: boolean}) {
3881
+ return this.members.cancelInviteByMemberId(invitee);
3862
3882
  }
3863
3883
 
3864
3884
  /**
@@ -7754,8 +7774,21 @@ export default class Meeting extends StatelessWebexPlugin {
7754
7774
  shareVideoEnabled = true,
7755
7775
  remoteMediaManagerConfig,
7756
7776
  bundlePolicy = 'max-bundle',
7777
+ additionalMediaOptions = {},
7757
7778
  } = options;
7758
7779
 
7780
+ const {
7781
+ sendVideo: rawSendVideo,
7782
+ receiveVideo: rawReceiveVideo,
7783
+ sendAudio: rawSendAudio,
7784
+ receiveAudio: rawReceiveAudio,
7785
+ } = additionalMediaOptions;
7786
+
7787
+ const sendVideo = videoEnabled && (rawSendVideo ?? true);
7788
+ const receiveVideo = videoEnabled && (rawReceiveVideo ?? true);
7789
+ const sendAudio = audioEnabled && (rawSendAudio ?? true);
7790
+ const receiveAudio = audioEnabled && (rawReceiveAudio ?? true);
7791
+
7759
7792
  this.allowMediaInLobby = options?.allowMediaInLobby;
7760
7793
 
7761
7794
  // If the user is unjoined or guest waiting in lobby dont allow the user to addMedia
@@ -7791,11 +7824,11 @@ export default class Meeting extends StatelessWebexPlugin {
7791
7824
  // when audioEnabled/videoEnabled is true, we set sendAudio/sendVideo to true even before any streams are published
7792
7825
  // to avoid doing an extra SDP exchange when they are published for the first time
7793
7826
  this.mediaProperties.setMediaDirection({
7794
- sendAudio: audioEnabled,
7795
- sendVideo: videoEnabled,
7827
+ sendAudio,
7828
+ sendVideo,
7796
7829
  sendShare: false,
7797
- receiveAudio: audioEnabled,
7798
- receiveVideo: videoEnabled,
7830
+ receiveAudio,
7831
+ receiveVideo,
7799
7832
  receiveShare: shareAudioEnabled || shareVideoEnabled,
7800
7833
  });
7801
7834
 
@@ -9721,21 +9754,91 @@ export default class Meeting extends StatelessWebexPlugin {
9721
9754
  return total;
9722
9755
  }, 0);
9723
9756
 
9757
+ const selectedSubnetFirstOctet = this.mediaServerIp?.split('.')[0];
9758
+
9724
9759
  let isSubnetReachable = null;
9725
- if (totalSuccessCases > 0) {
9726
- // @ts-ignore
9727
- isSubnetReachable = this.webex.meetings.reachability.isSubnetReachable(this.mediaServerIp);
9760
+ if (totalSuccessCases > 0 && selectedSubnetFirstOctet) {
9761
+ isSubnetReachable =
9762
+ // @ts-ignore
9763
+ this.webex.meetings.reachability.isSubnetReachable(selectedSubnetFirstOctet);
9728
9764
  }
9729
9765
 
9730
- let selectedCluster = null;
9731
- if (this.mediaConnections && this.mediaConnections.length > 0) {
9732
- selectedCluster = this.mediaConnections[0].mediaAgentCluster;
9733
- }
9766
+ const selectedCluster = this.mediaConnections?.[0]?.mediaAgentCluster ?? null;
9734
9767
 
9735
9768
  return {
9736
9769
  ...reachabilityMetrics,
9737
- isSubnetReachable,
9738
- selectedCluster,
9770
+ subnet_reachable: isSubnetReachable,
9771
+ selected_cluster: selectedCluster,
9772
+ selected_subnet: selectedSubnetFirstOctet ? `${selectedSubnetFirstOctet}.X.X.X` : null,
9773
+ };
9774
+ }
9775
+
9776
+ /**
9777
+ * Set the stage for the meeting
9778
+ *
9779
+ * @param {SetStageOptions} options Options to use when setting the stage
9780
+ * @returns {Promise} The locus request
9781
+ */
9782
+ setStage({
9783
+ activeSpeakerProportion = 0.5,
9784
+ customBackground,
9785
+ customLogo,
9786
+ customNameLabel,
9787
+ importantParticipants,
9788
+ lockAttendeeViewOnStage = false,
9789
+ showActiveSpeaker = false,
9790
+ }: SetStageOptions = {}) {
9791
+ const videoLayout: SetStageVideoLayout = {
9792
+ overrideDefault: true,
9793
+ lockAttendeeViewOnStageOnly: lockAttendeeViewOnStage,
9794
+ stageParameters: {
9795
+ activeSpeakerProportion,
9796
+ showActiveSpeaker: {show: showActiveSpeaker, order: 0},
9797
+ stageManagerType: 0,
9798
+ },
9739
9799
  };
9800
+
9801
+ if (importantParticipants?.length) {
9802
+ videoLayout.stageParameters.importantParticipants = importantParticipants.map(
9803
+ (importantParticipant, index) => ({...importantParticipant, order: index + 1})
9804
+ );
9805
+ }
9806
+
9807
+ if (customLogo) {
9808
+ if (!videoLayout.customLayouts) {
9809
+ videoLayout.customLayouts = {};
9810
+ }
9811
+ videoLayout.customLayouts.logo = customLogo;
9812
+ // eslint-disable-next-line no-bitwise
9813
+ videoLayout.stageParameters.stageManagerType |= STAGE_MANAGER_TYPE.LOGO;
9814
+ }
9815
+
9816
+ if (customBackground) {
9817
+ if (!videoLayout.customLayouts) {
9818
+ videoLayout.customLayouts = {};
9819
+ }
9820
+ videoLayout.customLayouts.background = customBackground;
9821
+ // eslint-disable-next-line no-bitwise
9822
+ videoLayout.stageParameters.stageManagerType |= STAGE_MANAGER_TYPE.BACKGROUND;
9823
+ }
9824
+
9825
+ if (customNameLabel) {
9826
+ videoLayout.nameLabelStyle = customNameLabel;
9827
+ // eslint-disable-next-line no-bitwise
9828
+ videoLayout.stageParameters.stageManagerType |= STAGE_MANAGER_TYPE.NAME_LABEL;
9829
+ }
9830
+
9831
+ return this.meetingRequest.synchronizeStage(this.locusUrl, videoLayout);
9832
+ }
9833
+
9834
+ /**
9835
+ * Unset the stage for the meeting
9836
+ *
9837
+ * @returns {Promise} The locus request
9838
+ */
9839
+ unsetStage() {
9840
+ const videoLayout: UnsetStageVideoLayout = {overrideDefault: false};
9841
+
9842
+ return this.meetingRequest.synchronizeStage(this.locusUrl, videoLayout);
9740
9843
  }
9741
9844
  }
@@ -32,6 +32,7 @@ import {
32
32
  BrbOptions,
33
33
  ToggleReactionsOptions,
34
34
  PostMeetingDataConsentOptions,
35
+ SynchronizeVideoLayout,
35
36
  } from './request.type';
36
37
  import MeetingUtil from './util';
37
38
  import {AnnotationInfo} from '../annotation/annotation.types';
@@ -969,4 +970,19 @@ export default class MeetingRequest extends StatelessWebexPlugin {
969
970
  },
970
971
  });
971
972
  }
973
+
974
+ /**
975
+ * Synchronize the stage for a meeting
976
+ *
977
+ * @param {LocusUrl} locusUrl The locus URL
978
+ * @param {SetStageVideoLayout} videoLayout The video layout to synchronize
979
+ * @returns {Promise} The locus request
980
+ */
981
+ synchronizeStage(locusUrl: string, videoLayout: SynchronizeVideoLayout) {
982
+ return this.locusDeltaRequest({
983
+ method: HTTP_VERBS.PATCH,
984
+ uri: `${locusUrl}/${CONTROLS}`,
985
+ body: {videoLayout},
986
+ });
987
+ }
972
988
  }
@@ -25,3 +25,67 @@ export type PostMeetingDataConsentOptions = {
25
25
  deviceUrl: string;
26
26
  selfId: string;
27
27
  };
28
+
29
+ export type StageCustomLogoPositions =
30
+ | 'LowerLeft'
31
+ | 'LowerMiddle'
32
+ | 'LowerRight'
33
+ | 'UpperLeft'
34
+ | 'UpperMiddle'
35
+ | 'UpperRight';
36
+
37
+ export type StageNameLabelType = 'Primary' | 'PrimaryInverted' | 'Secondary' | 'SecondaryInverted';
38
+
39
+ export type StageCustomBackground = {
40
+ url: string;
41
+ [others: string]: unknown;
42
+ };
43
+
44
+ export type StageCustomLogo = {
45
+ url: string;
46
+ position: StageCustomLogoPositions;
47
+ [others: string]: unknown;
48
+ };
49
+
50
+ export type StageCustomNameLabel = {
51
+ accentColor: string;
52
+ background: {color: string};
53
+ border: {color: string};
54
+ content: {displayName: {color: string}; subtitle: {color: string}};
55
+ decoration: {color: string};
56
+ fadeOut?: {delay: number};
57
+ type: StageNameLabelType;
58
+ [others: string]: unknown;
59
+ };
60
+
61
+ export type SetStageOptions = {
62
+ activeSpeakerProportion?: number;
63
+ customBackground?: StageCustomBackground;
64
+ customLogo?: StageCustomLogo;
65
+ customNameLabel?: StageCustomNameLabel;
66
+ importantParticipants?: {mainCsi: number; participantId: string}[];
67
+ lockAttendeeViewOnStage?: boolean;
68
+ showActiveSpeaker?: boolean;
69
+ };
70
+
71
+ export type SetStageVideoLayout = {
72
+ overrideDefault: true;
73
+ lockAttendeeViewOnStageOnly: boolean;
74
+ stageParameters: {
75
+ importantParticipants?: {participantId: string; mainCsi: number; order: number}[];
76
+ showActiveSpeaker: {show: boolean; order: number};
77
+ activeSpeakerProportion: number;
78
+ stageManagerType: number;
79
+ };
80
+ customLayouts?: {
81
+ background?: StageCustomBackground;
82
+ logo?: StageCustomLogo;
83
+ };
84
+ nameLabelStyle?: StageCustomNameLabel;
85
+ };
86
+
87
+ export type UnsetStageVideoLayout = {
88
+ overrideDefault: false;
89
+ };
90
+
91
+ export type SynchronizeVideoLayout = SetStageVideoLayout | UnsetStageVideoLayout;
@@ -1560,11 +1560,12 @@ export default class Meetings extends WebexPlugin {
1560
1560
  {
1561
1561
  // @ts-ignore
1562
1562
  parent: this.webex,
1563
+ },
1564
+ (newMeeting) => {
1565
+ this.meetingCollection.set(newMeeting);
1563
1566
  }
1564
1567
  );
1565
1568
 
1566
- this.meetingCollection.set(meeting);
1567
-
1568
1569
  try {
1569
1570
  // if no participant has joined the scheduled meeting (meaning meeting is not active) and we get a locusEvent,
1570
1571
  // it means the meeting will start in 5-6 min. In that case, we want to fetchMeetingInfo
@@ -846,12 +846,14 @@ export default class Members extends StatelessWebexPlugin {
846
846
  }
847
847
 
848
848
  /**
849
- * Cancels an SIP call to the associated meeting
850
- * @param {String} invitee
849
+ * Cancels an SIP/phone call to the associated meeting
850
+ * @param {Object} invitee
851
+ * @param {String} invitee.memberId - The memberId of the invitee
852
+ * @param {Boolean} [invitee.isInternalNumber] - When cancel phone invitation, if the number is internal
851
853
  * @returns {Promise}
852
854
  * @memberof Members
853
855
  */
854
- cancelSIPInvite(invitee: any) {
856
+ cancelInviteByMemberId(invitee: {memberId: string; isInternalNumber?: boolean}) {
855
857
  if (!this.locusUrl) {
856
858
  return Promise.reject(
857
859
  new ParameterError('The associated locus url for this meeting object must be defined.')
@@ -862,9 +864,9 @@ export default class Members extends StatelessWebexPlugin {
862
864
  new ParameterError('The invitee must be defined with a memberId property.')
863
865
  );
864
866
  }
865
- const options = MembersUtil.cancelSIPInviteOptions(invitee, this.locusUrl);
867
+ const options = MembersUtil.cancelInviteByMemberIdOptions(invitee, this.locusUrl);
866
868
 
867
- return this.membersRequest.cancelSIPInvite(options);
869
+ return this.membersRequest.cancelInviteByMemberId(options);
868
870
  }
869
871
 
870
872
  /**
@@ -285,14 +285,14 @@ export default class MembersRequest extends StatelessWebexPlugin {
285
285
  * @throws {Error} if the options are not valid and complete, must have invitee with memberId AND locusUrl
286
286
  * @memberof MembersRequest
287
287
  */
288
- cancelSIPInvite(options: any) {
288
+ cancelInviteByMemberId(options: any) {
289
289
  if (!options?.invitee?.memberId || !options?.locusUrl) {
290
290
  throw new ParameterError(
291
291
  'invitee must be passed and the associated locus url for this meeting object must be defined.'
292
292
  );
293
293
  }
294
294
 
295
- const requestParams = MembersUtil.generateCancelSIPInviteRequestParams(options);
295
+ const requestParams = MembersUtil.generateCancelInviteByMemberIdRequestParams(options);
296
296
 
297
297
  return this.locusDeltaRequest(requestParams);
298
298
  }
@@ -1,4 +1,5 @@
1
1
  import uuid from 'uuid';
2
+ import {has} from 'lodash';
2
3
  import {
3
4
  HTTP_VERBS,
4
5
  CONTROLS,
@@ -47,6 +48,9 @@ const MembersUtil = {
47
48
  address:
48
49
  options.invitee.emailAddress || options.invitee.email || options.invitee.phoneNumber,
49
50
  ...(options.invitee.roles ? {roles: options.invitee.roles} : {}),
51
+ ...(has(options.invitee, 'isInternalNumber')
52
+ ? {isInternalNumber: options.invitee.isInternalNumber}
53
+ : {}),
50
54
  },
51
55
  ],
52
56
  alertIfActive: options.alertIfActive,
@@ -107,6 +111,10 @@ const MembersUtil = {
107
111
  }
108
112
 
109
113
  if (invitee.phoneNumber) {
114
+ if (invitee.isInternalNumber) {
115
+ return !DIALER_REGEX.INTERNAL_NUMBER.test(invitee.phoneNumber);
116
+ }
117
+
110
118
  return !DIALER_REGEX.E164_FORMAT.test(invitee.phoneNumber);
111
119
  }
112
120
 
@@ -371,17 +379,20 @@ const MembersUtil = {
371
379
  return requestParams;
372
380
  },
373
381
 
374
- cancelSIPInviteOptions: (invitee, locusUrl) => ({
382
+ cancelInviteByMemberIdOptions: (invitee, locusUrl) => ({
375
383
  invitee,
376
384
  locusUrl,
377
385
  }),
378
386
 
379
- generateCancelSIPInviteRequestParams: (options) => {
387
+ generateCancelInviteByMemberIdRequestParams: (options) => {
388
+ const {memberId, isInternalNumber} = options.invitee;
389
+ const hasIsInternalNumberProp = has(options.invitee, 'isInternalNumber');
380
390
  const body = {
381
391
  actionType: _REMOVE_,
382
392
  invitees: [
383
393
  {
384
- address: options.invitee.memberId,
394
+ address: memberId,
395
+ ...(hasIsInternalNumberProp ? {isInternalNumber} : {}),
385
396
  },
386
397
  ],
387
398
  };
@@ -15,7 +15,7 @@ import {cloneDeepWith, debounce, isEmpty} from 'lodash';
15
15
  import LoggerProxy from '../common/logs/logger-proxy';
16
16
 
17
17
  import {ReceiveSlot, ReceiveSlotEvents} from './receiveSlot';
18
- import {getMaxFs} from './remoteMedia';
18
+ import {MAX_FS_VALUES} from './remoteMedia';
19
19
 
20
20
  export interface ActiveSpeakerPolicyInfo {
21
21
  policy: 'active-speaker';
@@ -123,12 +123,12 @@ export class MediaRequestManager {
123
123
 
124
124
  private getDegradedClientRequests(clientRequests: ClientRequestsMap) {
125
125
  const maxFsLimits = [
126
- getMaxFs('best'),
127
- getMaxFs('large'),
128
- getMaxFs('medium'),
129
- getMaxFs('small'),
130
- getMaxFs('very small'),
131
- getMaxFs('thumbnail'),
126
+ MAX_FS_VALUES['1080p'],
127
+ MAX_FS_VALUES['720p'],
128
+ MAX_FS_VALUES['540p'],
129
+ MAX_FS_VALUES['360p'],
130
+ MAX_FS_VALUES['180p'],
131
+ MAX_FS_VALUES['90p'],
132
132
  ];
133
133
 
134
134
  // reduce max-fs until total macroblocks is below limit
@@ -19,17 +19,18 @@ export type RemoteVideoResolution =
19
19
  | 'large' // 1080p or less
20
20
  | 'best'; // highest possible resolution
21
21
 
22
- const MAX_FS_VALUES = {
22
+ export const MAX_FS_VALUES = {
23
23
  '90p': 60,
24
24
  '180p': 240,
25
25
  '360p': 920,
26
+ '540p': 2040,
26
27
  '720p': 3600,
27
28
  '1080p': 8192,
28
29
  };
29
30
 
30
31
  /**
31
32
  * Converts pane size into h264 maxFs
32
- * @param {PaneSize} paneSize
33
+ * @param {RemoteVideoResolution} paneSize
33
34
  * @returns {number}
34
35
  */
35
36
  export function getMaxFs(paneSize: RemoteVideoResolution): number {
@@ -89,6 +90,13 @@ export class RemoteMedia extends EventsScope {
89
90
 
90
91
  public readonly id: RemoteMediaId;
91
92
 
93
+ /**
94
+ * The max frame size of the media request, used for logging and media requests.
95
+ * Set by setSizeHint() based on video element dimensions.
96
+ * When > 0, this value takes precedence over options.resolution in sendMediaRequest().
97
+ */
98
+ private maxFrameSize = 0;
99
+
92
100
  /**
93
101
  * Constructs RemoteMedia instance
94
102
  *
@@ -136,15 +144,34 @@ export class RemoteMedia extends EventsScope {
136
144
  fs = MAX_FS_VALUES['180p'];
137
145
  } else if (height < getThresholdHeight(360)) {
138
146
  fs = MAX_FS_VALUES['360p'];
147
+ } else if (height < getThresholdHeight(540)) {
148
+ fs = MAX_FS_VALUES['540p'];
139
149
  } else if (height <= 720) {
140
150
  fs = MAX_FS_VALUES['720p'];
141
151
  } else {
142
152
  fs = MAX_FS_VALUES['1080p'];
143
153
  }
144
154
 
155
+ this.maxFrameSize = fs;
145
156
  this.receiveSlot?.setMaxFs(fs);
146
157
  }
147
158
 
159
+ /**
160
+ * Get the current effective maxFs value that would be used in media requests
161
+ * @returns {number | undefined} The maxFs value, or undefined if no constraints
162
+ */
163
+ public getEffectiveMaxFs(): number | undefined {
164
+ if (this.maxFrameSize > 0) {
165
+ return this.maxFrameSize;
166
+ }
167
+
168
+ if (this.options.resolution) {
169
+ return getMaxFs(this.options.resolution);
170
+ }
171
+
172
+ return undefined;
173
+ }
174
+
148
175
  /**
149
176
  * Invalidates the remote media by clearing the reference to a receive slot and
150
177
  * cancelling the media request.
@@ -185,6 +212,9 @@ export class RemoteMedia extends EventsScope {
185
212
  throw new Error('sendMediaRequest() called on an invalidated RemoteMedia instance');
186
213
  }
187
214
 
215
+ // Use maxFrameSize from setSizeHint if available, otherwise fallback to options.resolution
216
+ const maxFs = this.getEffectiveMaxFs();
217
+
188
218
  this.mediaRequestId = this.mediaRequestManager.addRequest(
189
219
  {
190
220
  policyInfo: {
@@ -192,9 +222,9 @@ export class RemoteMedia extends EventsScope {
192
222
  csi,
193
223
  },
194
224
  receiveSlots: [this.receiveSlot],
195
- codecInfo: this.options.resolution && {
225
+ codecInfo: maxFs && {
196
226
  codec: 'h264',
197
- maxFs: getMaxFs(this.options.resolution),
227
+ maxFs,
198
228
  },
199
229
  },
200
230
  commit
@@ -215,6 +215,9 @@ export class RemoteMediaGroup {
215
215
  private sendActiveSpeakerMediaRequest(commit: boolean) {
216
216
  this.cancelActiveSpeakerMediaRequest(false);
217
217
 
218
+ // Calculate the effective maxFs based on all unpinned RemoteMedia instances
219
+ const effectiveMaxFs = this.getEffectiveMaxFsForActiveSpeaker();
220
+
218
221
  this.mediaRequestId = this.mediaRequestManager.addRequest(
219
222
  {
220
223
  policyInfo: {
@@ -230,9 +233,9 @@ export class RemoteMediaGroup {
230
233
  receiveSlots: this.unpinnedRemoteMedia.map((remoteMedia) =>
231
234
  remoteMedia.getUnderlyingReceiveSlot()
232
235
  ) as ReceiveSlot[],
233
- codecInfo: this.options.resolution && {
236
+ codecInfo: effectiveMaxFs && {
234
237
  codec: 'h264',
235
- maxFs: getMaxFs(this.options.resolution),
238
+ maxFs: effectiveMaxFs,
236
239
  },
237
240
  },
238
241
  commit
@@ -300,4 +303,36 @@ export class RemoteMediaGroup {
300
303
  this.unpinnedRemoteMedia.includes(remoteMedia) || this.pinnedRemoteMedia.includes(remoteMedia)
301
304
  );
302
305
  }
306
+
307
+ /**
308
+ * Calculate the effective maxFs for the active speaker media request based on unpinned RemoteMedia instances
309
+ * @returns {number | undefined} The calculated maxFs value, or undefined if no constraints
310
+ * @private
311
+ */
312
+ private getEffectiveMaxFsForActiveSpeaker(): number | undefined {
313
+ // Get all effective maxFs values from unpinned RemoteMedia instances
314
+ const maxFsValues = this.unpinnedRemoteMedia
315
+ .map((remoteMedia) => remoteMedia.getEffectiveMaxFs())
316
+ .filter((maxFs) => maxFs !== undefined);
317
+
318
+ // Use the highest maxFs value to ensure we don't under-request resolution for any instance
319
+ if (maxFsValues.length > 0) {
320
+ return Math.max(...maxFsValues);
321
+ }
322
+
323
+ // Fall back to group's resolution option
324
+ if (this.options.resolution) {
325
+ return getMaxFs(this.options.resolution);
326
+ }
327
+
328
+ return undefined;
329
+ }
330
+
331
+ /**
332
+ * Get the current effective maxFs that would be used for the active speaker media request
333
+ * @returns {number | undefined} The effective maxFs value
334
+ */
335
+ public getEffectiveMaxFs(): number | undefined {
336
+ return this.getEffectiveMaxFsForActiveSpeaker();
337
+ }
303
338
  }