@azure/communication-react 1.22.0-alpha-202412070017 → 1.22.0-alpha-202412100018

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 (45) hide show
  1. package/dist/communication-react.d.ts +60 -10
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CTHWXMl0.js → ChatMessageComponentAsRichTextEditBox-Bpez2mhK.js} +2 -2
  3. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CTHWXMl0.js.map → ChatMessageComponentAsRichTextEditBox-Bpez2mhK.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-C0YPqtKB.js → RichTextSendBoxWrapper-CrmMCuXY.js} +2 -2
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-C0YPqtKB.js.map → RichTextSendBoxWrapper-CrmMCuXY.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-Bf1eybwR.js → index-DIxf34Zj.js} +176 -40
  7. package/dist/dist-cjs/communication-react/index-DIxf34Zj.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  11. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +5 -0
  12. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +8 -0
  13. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  14. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +48 -8
  15. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +20 -20
  16. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js +45 -3
  18. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js.map +1 -1
  19. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.d.ts +1 -1
  20. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +11 -5
  21. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
  22. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +7 -1
  23. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
  24. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +5 -1
  25. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  26. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +2 -1
  27. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +15 -0
  28. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  29. package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.d.ts +1 -0
  30. package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js +62 -0
  31. package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js.map +1 -1
  32. package/dist/dist-esm/calling-stateful-client/src/MediaAccessSubscriber.d.ts +1 -0
  33. package/dist/dist-esm/calling-stateful-client/src/MediaAccessSubscriber.js +7 -4
  34. package/dist/dist-esm/calling-stateful-client/src/MediaAccessSubscriber.js.map +1 -1
  35. package/dist/dist-esm/react-components/src/components/NotificationStack.d.ts +4 -0
  36. package/dist/dist-esm/react-components/src/components/NotificationStack.js.map +1 -1
  37. package/dist/dist-esm/react-components/src/types/TogetherModeTypes.d.ts +7 -31
  38. package/dist/dist-esm/react-components/src/types/TogetherModeTypes.js.map +1 -1
  39. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.d.ts +3 -1
  40. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js.map +1 -1
  41. package/dist/dist-esm/react-composites/src/composites/common/AudioProvider.d.ts +1 -1
  42. package/dist/dist-esm/react-composites/src/composites/common/AudioProvider.js +8 -3
  43. package/dist/dist-esm/react-composites/src/composites/common/AudioProvider.js.map +1 -1
  44. package/package.json +2 -2
  45. package/dist/dist-cjs/communication-react/index-Bf1eybwR.js.map +0 -1
@@ -2,7 +2,9 @@
2
2
  // Licensed under the MIT License.
3
3
  import { getDeviceManager, getDiagnostics, getLatestErrors, getEnvironmentInfo } from './baseSelectors';
4
4
  /* @conditional-compile-remove(breakout-rooms) */
5
- import { getLatestNotifications, getAssignedBreakoutRoom } from './baseSelectors';
5
+ import { getAssignedBreakoutRoom } from './baseSelectors';
6
+ /* @conditional-compile-remove(breakout-rooms) */ /* @conditional-compile-remove(media-access) */
7
+ import { getLatestNotifications } from './baseSelectors';
6
8
  import { getMeetingConferencePhones } from './baseSelectors';
7
9
  import { createSelector } from 'reselect';
8
10
  import { DiagnosticQuality } from '@azure/communication-calling';
@@ -24,7 +26,7 @@ export const notificationStackSelector = createSelector([
24
26
  getMeetingConferencePhones,
25
27
  /* @conditional-compile-remove(breakout-rooms) */ getAssignedBreakoutRoom
26
28
  ], (latestErrors,
27
- /* @conditional-compile-remove(breakout-rooms) */ latestNotifications, diagnostics, deviceManager, environmentInfo, meetingConference,
29
+ /* @conditional-compile-remove(breakout-rooms) */ /* @conditional-compile-remove(media-access) */ latestNotifications, diagnostics, deviceManager, environmentInfo, meetingConference,
28
30
  /* @conditional-compile-remove(breakout-rooms) */ assignedBreakoutRoom) => {
29
31
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
30
32
  // The order in which the errors are returned is significant: The `Notification` shows errors on the UI in that order.
@@ -135,7 +137,8 @@ export const notificationStackSelector = createSelector([
135
137
  appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'startVideoGeneric');
136
138
  }
137
139
  appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.unmute', 'unmuteGeneric');
138
- appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.mutedByOthers', 'mutedByRemoteParticipant');
140
+ appendMuteByOthersNotificationTrampoline(activeErrorMessages, latestErrors,
141
+ /* @conditional-compile-remove(media-access) */ latestNotifications);
139
142
  appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'VideoEffectsFeature.startEffects', 'unableToStartVideoEffect');
140
143
  if (((_s = latestErrors['CallAgent.join']) === null || _s === void 0 ? void 0 : _s.message) === 'CallAgent.join: Invalid meeting link') {
141
144
  appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'CallAgent.join', 'failedToJoinCallInvalidMeetingLink');
@@ -192,6 +195,34 @@ export const notificationStackSelector = createSelector([
192
195
  timestamp: latestNotifications['breakoutRoomClosingSoon'].timestamp
193
196
  });
194
197
  }
198
+ /* @conditional-compile-remove(media-access) */
199
+ if (latestNotifications['capabilityTurnVideoOnPresent']) {
200
+ activeNotifications.push({
201
+ type: 'capabilityTurnVideoOnPresent',
202
+ timestamp: latestNotifications['capabilityTurnVideoOnPresent'].timestamp
203
+ });
204
+ }
205
+ /* @conditional-compile-remove(media-access) */
206
+ if (latestNotifications['capabilityTurnVideoOnAbsent']) {
207
+ activeNotifications.push({
208
+ type: 'capabilityTurnVideoOnAbsent',
209
+ timestamp: latestNotifications['capabilityTurnVideoOnAbsent'].timestamp
210
+ });
211
+ }
212
+ /* @conditional-compile-remove(media-access) */
213
+ if (latestNotifications['capabilityUnmuteMicPresent']) {
214
+ activeNotifications.push({
215
+ type: 'capabilityUnmuteMicPresent',
216
+ timestamp: latestNotifications['capabilityUnmuteMicPresent'].timestamp
217
+ });
218
+ }
219
+ /* @conditional-compile-remove(media-access) */
220
+ if (latestNotifications['capabilityUnmuteMicAbsent']) {
221
+ activeNotifications.push({
222
+ type: 'capabilityUnmuteMicAbsent',
223
+ timestamp: latestNotifications['capabilityUnmuteMicAbsent'].timestamp
224
+ });
225
+ }
195
226
  return { activeErrorMessages: activeErrorMessages, activeNotifications: activeNotifications };
196
227
  });
197
228
  const appendActiveErrorIfDefined = (activeErrorMessages, latestErrors, target, activeErrorType) => {
@@ -203,4 +234,15 @@ const appendActiveErrorIfDefined = (activeErrorMessages, latestErrors, target, a
203
234
  timestamp: latestErrors[target].timestamp
204
235
  });
205
236
  };
237
+ const appendMuteByOthersNotificationTrampoline = (activeErrorMessages, latestErrors, latestNotifications) => {
238
+ /* @conditional-compile-remove(media-access) */
239
+ if (latestNotifications &&
240
+ !latestNotifications['capabilityUnmuteMicAbsent'] &&
241
+ !latestNotifications['capabilityUnmuteMicPresent']) {
242
+ appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.mutedByOthers', 'mutedByRemoteParticipant');
243
+ }
244
+ /* @conditional-compile-remove(media-access) */
245
+ return;
246
+ appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.mutedByOthers', 'mutedByRemoteParticipant');
247
+ };
206
248
  //# sourceMappingURL=notificationStackSelector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notificationStackSelector.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/notificationStackSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAEL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AACzB,iDAAiD;AACjD,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAElF,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAI7D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAejE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAA8B,cAAc,CAChF;IACE,eAAe;IACf,iDAAiD,CAAC,sBAAsB;IACxE,cAAc;IACd,gBAAgB;IAChB,kBAAkB;IAClB,0BAA0B;IAC1B,iDAAiD,CAAC,uBAAuB;CAC1E,EACD,CACE,YAAwB;A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mB,CAAC,6BAA6B,CAAC,CAAC,SAAS;SACxE,CAAC,CAAC;IACL,CAAC;IACD,iDAAiD;IACjD,IAAI,mBAAmB,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC9C,mBAAmB,CAAC,IAAI,CAAC;YACvB,IAAI,EAAE,oBAAoB;YAC1B,SAAS,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC,SAAS;SAC/D,CAAC,CAAC;IACL,CAAC;IACD,iDAAiD;IACjD,IAAI,mBAAmB,CAAC,yBAAyB,CAAC,EAAE,CAAC;QACnD,mBAAmB,CAAC,IAAI,CAAC;YACvB,IAAI,EAAE,yBAAyB;YAC/B,SAAS,EAAE,mBAAmB,CAAC,yBAAyB,CAAC,CAAC,SAAS;SACpE,CAAC,CAAC;IACL,CAAC;IACD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;AAChG,CAAC,CACF,CAAC;AAEF,MAAM,0BAA0B,GAAG,CACjC,mBAAyC,EACzC,YAAwB,EACxB,MAAuB,EACvB,eAAiC,EAC3B,EAAE;IACR,IAAI,YAAY,CAAC,MAAM,CAAC,KAAK,SAAS,EAAE,CAAC;QACvC,OAAO;IACT,CAAC;IACD,mBAAmB,CAAC,IAAI,CAAC;QACvB,IAAI,EAAE,eAAe;QACrB,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,SAAS;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n CallingBaseSelectorProps,\n getDeviceManager,\n getDiagnostics,\n getLatestErrors,\n getEnvironmentInfo\n} from './baseSelectors';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { getLatestNotifications, getAssignedBreakoutRoom } from './baseSelectors';\n\nimport { getMeetingConferencePhones } from './baseSelectors';\n\nimport { ActiveNotification, NotificationType } from '@internal/react-components';\n\nimport { createSelector } from 'reselect';\n\nimport { CallClientState, CallErrors, CallErrorTarget } from '@internal/calling-stateful-client';\n\nimport { DiagnosticQuality } from '@azure/communication-calling';\n\n/**\n * Selector type for {@link Notification} component.\n *\n * @public\n */\nexport type NotificationStackSelector = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n) => {\n activeErrorMessages: ActiveNotification[];\n activeNotifications: ActiveNotification[];\n};\n\n/**\n * Select the active errors from the state for the `Notification` component.\n *\n * Invariants:\n * - `ErrorType` is never repeated in the returned errors.\n * - Errors are returned in a fixed order by `ErrorType`.\n *\n * @public\n */\nexport const notificationStackSelector: NotificationStackSelector = createSelector(\n [\n getLatestErrors,\n /* @conditional-compile-remove(breakout-rooms) */ getLatestNotifications,\n getDiagnostics,\n getDeviceManager,\n getEnvironmentInfo,\n getMeetingConferencePhones,\n /* @conditional-compile-remove(breakout-rooms) */ getAssignedBreakoutRoom\n ],\n (\n latestErrors: CallErrors,\n /* @conditional-compile-remove(breakout-rooms) */ latestNotifications,\n diagnostics,\n deviceManager,\n environmentInfo,\n meetingConference,\n /* @conditional-compile-remove(breakout-rooms) */ assignedBreakoutRoom\n ): { activeErrorMessages: ActiveNotification[]; activeNotifications: ActiveNotification[] } => {\n // The order in which the errors are returned is significant: The `Notification` shows errors on the UI in that order.\n // There are several options for the ordering:\n // - Sorted by when the errors happened (latest first / oldest first).\n // - Stable sort by error type.\n //\n // We chose to stable sort by error type: We intend to show only a small number of errors on the UI and we do not\n // have timestamps for errors.\n const activeErrorMessages: ActiveNotification[] = [];\n\n const isSafari = (): boolean => {\n return environmentInfo?.environment.browser === 'safari';\n };\n\n const isMacOS = (): boolean => {\n return environmentInfo?.environment.platform === 'mac';\n };\n\n // Errors reported via diagnostics are more reliable than from API method failures, so process those first.\n let isTeamsMeetingWithPhones = false;\n\n if (meetingConference && meetingConference.length > 0) {\n isTeamsMeetingWithPhones = true;\n }\n if (\n diagnostics?.network.latest.networkReceiveQuality?.value === DiagnosticQuality.Bad ||\n diagnostics?.network.latest.networkReceiveQuality?.value === DiagnosticQuality.Poor\n ) {\n if (isTeamsMeetingWithPhones) {\n activeErrorMessages.push({ type: 'teamsMeetingCallNetworkQualityLow' });\n } else {\n activeErrorMessages.push({ type: 'callNetworkQualityLow' });\n }\n }\n if (diagnostics?.media.latest.noSpeakerDevicesEnumerated?.value === true) {\n activeErrorMessages.push({ type: 'callNoSpeakerFound' });\n }\n if (diagnostics?.media.latest.noMicrophoneDevicesEnumerated?.value === true) {\n activeErrorMessages.push({ type: 'callNoMicrophoneFound' });\n }\n if (deviceManager.deviceAccess?.audio === false && isSafari()) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDeniedSafari' });\n }\n if (deviceManager.deviceAccess?.audio === false && !isSafari()) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });\n }\n\n if (diagnostics?.media.latest.microphonePermissionDenied?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsMicrophoneAccessDenied' });\n } else if (diagnostics?.media.latest.microphonePermissionDenied?.value === true) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });\n }\n\n const microphoneMuteUnexpectedlyDiagnostic =\n diagnostics?.media.latest.microphoneMuteUnexpectedly || diagnostics?.media.latest.microphoneNotFunctioning;\n if (microphoneMuteUnexpectedlyDiagnostic) {\n if (microphoneMuteUnexpectedlyDiagnostic.value === DiagnosticQuality.Bad) {\n // Inform the user that microphone stopped working and inform them to start microphone again\n activeErrorMessages.push({ type: 'callMicrophoneMutedBySystem' });\n } else if (microphoneMuteUnexpectedlyDiagnostic.value === DiagnosticQuality.Good) {\n // Inform the user that microphone recovered\n activeErrorMessages.push({ type: 'callMicrophoneUnmutedBySystem' });\n }\n }\n\n const cameraStoppedUnexpectedlyDiagnostic = diagnostics?.media.latest.cameraStoppedUnexpectedly;\n if (cameraStoppedUnexpectedlyDiagnostic) {\n if (cameraStoppedUnexpectedlyDiagnostic.value === DiagnosticQuality.Bad) {\n // Inform the user that camera stopped working and inform them to start video again\n activeErrorMessages.push({ type: 'callVideoStoppedBySystem' });\n } else if (cameraStoppedUnexpectedlyDiagnostic.value === DiagnosticQuality.Good) {\n // Inform the user that camera recovered\n activeErrorMessages.push({ type: 'callVideoRecoveredBySystem' });\n }\n }\n if (deviceManager.deviceAccess?.video === false && isSafari()) {\n activeErrorMessages.push({ type: 'callCameraAccessDeniedSafari' });\n } else if (deviceManager.deviceAccess?.video === false) {\n activeErrorMessages.push({ type: 'callCameraAccessDenied' });\n } else {\n if (diagnostics?.media.latest.cameraFreeze?.value === true) {\n activeErrorMessages.push({ type: 'cameraFrozenForRemoteParticipants' });\n }\n }\n\n /**\n * show the Mac specific strings if the platform is detected as mac\n */\n if (diagnostics?.media.latest.cameraPermissionDenied?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsCameraAccessDenied' });\n }\n\n /**\n * This UFD only works on mac still so we should only see it fire on mac.\n */\n if (diagnostics?.media.latest.screenshareRecordingDisabled?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsScreenShareAccessDenied' });\n } else if (diagnostics?.media.latest.screenshareRecordingDisabled?.value === true) {\n activeErrorMessages.push({ type: 'startScreenShareGeneric' });\n }\n\n // Prefer to show errors with privacy implications.\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.stopVideo', 'stopVideoGeneric');\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.mute', 'muteGeneric');\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.stopScreenSharing', 'stopScreenShareGeneric');\n\n if (\n latestErrors['Call.startVideo']?.message === 'Call.startVideo: Video operation failure SourceUnavailableError'\n ) {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'callCameraAlreadyInUse');\n } else if (\n latestErrors['Call.startVideo']?.message === 'Call.startVideo: Video operation failure permissionDeniedError'\n ) {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'callCameraAccessDenied');\n } else {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'startVideoGeneric');\n }\n\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.unmute', 'unmuteGeneric');\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.mutedByOthers', 'mutedByRemoteParticipant');\n appendActiveErrorIfDefined(\n activeErrorMessages,\n latestErrors,\n 'VideoEffectsFeature.startEffects',\n 'unableToStartVideoEffect'\n );\n\n if (latestErrors['CallAgent.join']?.message === 'CallAgent.join: Invalid meeting link') {\n appendActiveErrorIfDefined(\n activeErrorMessages,\n latestErrors,\n 'CallAgent.join',\n 'failedToJoinCallInvalidMeetingLink'\n );\n } else {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'CallAgent.join', 'failedToJoinCallGeneric');\n }\n\n if (\n latestErrors['Call.feature']?.message.match(\n /Call\\.feature: startSpotlight failed\\. \\d+ is the max number of participants that can be Spotlighted/g\n )\n ) {\n appendActiveErrorIfDefined(\n activeErrorMessages,\n latestErrors,\n 'Call.feature',\n 'startSpotlightWhileMaxParticipantsAreSpotlighted'\n );\n }\n\n //below is for active notifications\n const activeNotifications: ActiveNotification[] = [];\n if (diagnostics?.media.latest.speakingWhileMicrophoneIsMuted?.value) {\n activeNotifications.push({\n type: 'speakingWhileMuted',\n timestamp: new Date(Date.now()),\n autoDismiss: true,\n ariaLive: 'off' // \"You're muted\" is too noisy, so we don't want to announce it.\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['assignedBreakoutRoomOpened']) {\n activeNotifications.push({\n type: 'assignedBreakoutRoomOpened',\n timestamp: latestNotifications['assignedBreakoutRoomOpened'].timestamp\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['assignedBreakoutRoomOpenedPromptJoin'] && assignedBreakoutRoom) {\n activeNotifications.push({\n type: 'assignedBreakoutRoomOpenedPromptJoin',\n timestamp: latestNotifications['assignedBreakoutRoomOpenedPromptJoin'].timestamp,\n onClickPrimaryButton: () => assignedBreakoutRoom.join()\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['assignedBreakoutRoomChanged']) {\n activeNotifications.push({\n type: 'assignedBreakoutRoomChanged',\n timestamp: latestNotifications['assignedBreakoutRoomChanged'].timestamp\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['breakoutRoomJoined']) {\n activeNotifications.push({\n type: 'breakoutRoomJoined',\n timestamp: latestNotifications['breakoutRoomJoined'].timestamp\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['breakoutRoomClosingSoon']) {\n activeNotifications.push({\n type: 'breakoutRoomClosingSoon',\n timestamp: latestNotifications['breakoutRoomClosingSoon'].timestamp\n });\n }\n return { activeErrorMessages: activeErrorMessages, activeNotifications: activeNotifications };\n }\n);\n\nconst appendActiveErrorIfDefined = (\n activeErrorMessages: ActiveNotification[],\n latestErrors: CallErrors,\n target: CallErrorTarget,\n activeErrorType: NotificationType\n): void => {\n if (latestErrors[target] === undefined) {\n return;\n }\n activeErrorMessages.push({\n type: activeErrorType,\n timestamp: latestErrors[target].timestamp\n });\n};\n"]}
1
+ {"version":3,"file":"notificationStackSelector.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/notificationStackSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAEL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AACzB,iDAAiD;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,iDAAiD,CAAC,+CAA+C;AACjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAI7D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAA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microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n CallingBaseSelectorProps,\n getDeviceManager,\n getDiagnostics,\n getLatestErrors,\n getEnvironmentInfo\n} from './baseSelectors';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { getAssignedBreakoutRoom } from './baseSelectors';\n/* @conditional-compile-remove(breakout-rooms) */ /* @conditional-compile-remove(media-access) */\nimport { getLatestNotifications } from './baseSelectors';\n\nimport { getMeetingConferencePhones } from './baseSelectors';\n\nimport { ActiveNotification, NotificationType } from '@internal/react-components';\n\nimport { createSelector } from 'reselect';\n\nimport { CallClientState, CallErrors, CallErrorTarget } from '@internal/calling-stateful-client';\n\nimport { DiagnosticQuality } from '@azure/communication-calling';\n\n/* @conditional-compile-remove(media-access) */\nimport { CallNotifications } from '@internal/calling-stateful-client';\n\n/**\n * Selector type for {@link Notification} component.\n *\n * @public\n */\nexport type NotificationStackSelector = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n) => {\n activeErrorMessages: ActiveNotification[];\n activeNotifications: ActiveNotification[];\n};\n\n/**\n * Select the active errors from the state for the `Notification` component.\n *\n * Invariants:\n * - `ErrorType` is never repeated in the returned errors.\n * - Errors are returned in a fixed order by `ErrorType`.\n *\n * @public\n */\nexport const notificationStackSelector: NotificationStackSelector = createSelector(\n [\n getLatestErrors,\n /* @conditional-compile-remove(breakout-rooms) */ getLatestNotifications,\n getDiagnostics,\n getDeviceManager,\n getEnvironmentInfo,\n getMeetingConferencePhones,\n /* @conditional-compile-remove(breakout-rooms) */ getAssignedBreakoutRoom\n ],\n (\n latestErrors: CallErrors,\n /* @conditional-compile-remove(breakout-rooms) */ /* @conditional-compile-remove(media-access) */ latestNotifications,\n diagnostics,\n deviceManager,\n environmentInfo,\n meetingConference,\n /* @conditional-compile-remove(breakout-rooms) */ assignedBreakoutRoom\n ): { activeErrorMessages: ActiveNotification[]; activeNotifications: ActiveNotification[] } => {\n // The order in which the errors are returned is significant: The `Notification` shows errors on the UI in that order.\n // There are several options for the ordering:\n // - Sorted by when the errors happened (latest first / oldest first).\n // - Stable sort by error type.\n //\n // We chose to stable sort by error type: We intend to show only a small number of errors on the UI and we do not\n // have timestamps for errors.\n const activeErrorMessages: ActiveNotification[] = [];\n\n const isSafari = (): boolean => {\n return environmentInfo?.environment.browser === 'safari';\n };\n\n const isMacOS = (): boolean => {\n return environmentInfo?.environment.platform === 'mac';\n };\n\n // Errors reported via diagnostics are more reliable than from API method failures, so process those first.\n let isTeamsMeetingWithPhones = false;\n\n if (meetingConference && meetingConference.length > 0) {\n isTeamsMeetingWithPhones = true;\n }\n if (\n diagnostics?.network.latest.networkReceiveQuality?.value === DiagnosticQuality.Bad ||\n diagnostics?.network.latest.networkReceiveQuality?.value === DiagnosticQuality.Poor\n ) {\n if (isTeamsMeetingWithPhones) {\n activeErrorMessages.push({ type: 'teamsMeetingCallNetworkQualityLow' });\n } else {\n activeErrorMessages.push({ type: 'callNetworkQualityLow' });\n }\n }\n if (diagnostics?.media.latest.noSpeakerDevicesEnumerated?.value === true) {\n activeErrorMessages.push({ type: 'callNoSpeakerFound' });\n }\n if (diagnostics?.media.latest.noMicrophoneDevicesEnumerated?.value === true) {\n activeErrorMessages.push({ type: 'callNoMicrophoneFound' });\n }\n if (deviceManager.deviceAccess?.audio === false && isSafari()) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDeniedSafari' });\n }\n if (deviceManager.deviceAccess?.audio === false && !isSafari()) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });\n }\n\n if (diagnostics?.media.latest.microphonePermissionDenied?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsMicrophoneAccessDenied' });\n } else if (diagnostics?.media.latest.microphonePermissionDenied?.value === true) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });\n }\n\n const microphoneMuteUnexpectedlyDiagnostic =\n diagnostics?.media.latest.microphoneMuteUnexpectedly || diagnostics?.media.latest.microphoneNotFunctioning;\n if (microphoneMuteUnexpectedlyDiagnostic) {\n if (microphoneMuteUnexpectedlyDiagnostic.value === DiagnosticQuality.Bad) {\n // Inform the user that microphone stopped working and inform them to start microphone again\n activeErrorMessages.push({ type: 'callMicrophoneMutedBySystem' });\n } else if (microphoneMuteUnexpectedlyDiagnostic.value === DiagnosticQuality.Good) {\n // Inform the user that microphone recovered\n activeErrorMessages.push({ type: 'callMicrophoneUnmutedBySystem' });\n }\n }\n\n const cameraStoppedUnexpectedlyDiagnostic = diagnostics?.media.latest.cameraStoppedUnexpectedly;\n if (cameraStoppedUnexpectedlyDiagnostic) {\n if (cameraStoppedUnexpectedlyDiagnostic.value === DiagnosticQuality.Bad) {\n // Inform the user that camera stopped working and inform them to start video again\n activeErrorMessages.push({ type: 'callVideoStoppedBySystem' });\n } else if (cameraStoppedUnexpectedlyDiagnostic.value === DiagnosticQuality.Good) {\n // Inform the user that camera recovered\n activeErrorMessages.push({ type: 'callVideoRecoveredBySystem' });\n }\n }\n if (deviceManager.deviceAccess?.video === false && isSafari()) {\n activeErrorMessages.push({ type: 'callCameraAccessDeniedSafari' });\n } else if (deviceManager.deviceAccess?.video === false) {\n activeErrorMessages.push({ type: 'callCameraAccessDenied' });\n } else {\n if (diagnostics?.media.latest.cameraFreeze?.value === true) {\n activeErrorMessages.push({ type: 'cameraFrozenForRemoteParticipants' });\n }\n }\n\n /**\n * show the Mac specific strings if the platform is detected as mac\n */\n if (diagnostics?.media.latest.cameraPermissionDenied?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsCameraAccessDenied' });\n }\n\n /**\n * This UFD only works on mac still so we should only see it fire on mac.\n */\n if (diagnostics?.media.latest.screenshareRecordingDisabled?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsScreenShareAccessDenied' });\n } else if (diagnostics?.media.latest.screenshareRecordingDisabled?.value === true) {\n activeErrorMessages.push({ type: 'startScreenShareGeneric' });\n }\n\n // Prefer to show errors with privacy implications.\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.stopVideo', 'stopVideoGeneric');\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.mute', 'muteGeneric');\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.stopScreenSharing', 'stopScreenShareGeneric');\n\n if (\n latestErrors['Call.startVideo']?.message === 'Call.startVideo: Video operation failure SourceUnavailableError'\n ) {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'callCameraAlreadyInUse');\n } else if (\n latestErrors['Call.startVideo']?.message === 'Call.startVideo: Video operation failure permissionDeniedError'\n ) {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'callCameraAccessDenied');\n } else {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'startVideoGeneric');\n }\n\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.unmute', 'unmuteGeneric');\n appendMuteByOthersNotificationTrampoline(\n activeErrorMessages,\n latestErrors,\n /* @conditional-compile-remove(media-access) */ latestNotifications\n );\n appendActiveErrorIfDefined(\n activeErrorMessages,\n latestErrors,\n 'VideoEffectsFeature.startEffects',\n 'unableToStartVideoEffect'\n );\n\n if (latestErrors['CallAgent.join']?.message === 'CallAgent.join: Invalid meeting link') {\n appendActiveErrorIfDefined(\n activeErrorMessages,\n latestErrors,\n 'CallAgent.join',\n 'failedToJoinCallInvalidMeetingLink'\n );\n } else {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'CallAgent.join', 'failedToJoinCallGeneric');\n }\n\n if (\n latestErrors['Call.feature']?.message.match(\n /Call\\.feature: startSpotlight failed\\. \\d+ is the max number of participants that can be Spotlighted/g\n )\n ) {\n appendActiveErrorIfDefined(\n activeErrorMessages,\n latestErrors,\n 'Call.feature',\n 'startSpotlightWhileMaxParticipantsAreSpotlighted'\n );\n }\n\n //below is for active notifications\n const activeNotifications: ActiveNotification[] = [];\n if (diagnostics?.media.latest.speakingWhileMicrophoneIsMuted?.value) {\n activeNotifications.push({\n type: 'speakingWhileMuted',\n timestamp: new Date(Date.now()),\n autoDismiss: true,\n ariaLive: 'off' // \"You're muted\" is too noisy, so we don't want to announce it.\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['assignedBreakoutRoomOpened']) {\n activeNotifications.push({\n type: 'assignedBreakoutRoomOpened',\n timestamp: latestNotifications['assignedBreakoutRoomOpened'].timestamp\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['assignedBreakoutRoomOpenedPromptJoin'] && assignedBreakoutRoom) {\n activeNotifications.push({\n type: 'assignedBreakoutRoomOpenedPromptJoin',\n timestamp: latestNotifications['assignedBreakoutRoomOpenedPromptJoin'].timestamp,\n onClickPrimaryButton: () => assignedBreakoutRoom.join()\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['assignedBreakoutRoomChanged']) {\n activeNotifications.push({\n type: 'assignedBreakoutRoomChanged',\n timestamp: latestNotifications['assignedBreakoutRoomChanged'].timestamp\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['breakoutRoomJoined']) {\n activeNotifications.push({\n type: 'breakoutRoomJoined',\n timestamp: latestNotifications['breakoutRoomJoined'].timestamp\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['breakoutRoomClosingSoon']) {\n activeNotifications.push({\n type: 'breakoutRoomClosingSoon',\n timestamp: latestNotifications['breakoutRoomClosingSoon'].timestamp\n });\n }\n\n /* @conditional-compile-remove(media-access) */\n if (latestNotifications['capabilityTurnVideoOnPresent']) {\n activeNotifications.push({\n type: 'capabilityTurnVideoOnPresent',\n timestamp: latestNotifications['capabilityTurnVideoOnPresent'].timestamp\n });\n }\n\n /* @conditional-compile-remove(media-access) */\n if (latestNotifications['capabilityTurnVideoOnAbsent']) {\n activeNotifications.push({\n type: 'capabilityTurnVideoOnAbsent',\n timestamp: latestNotifications['capabilityTurnVideoOnAbsent'].timestamp\n });\n }\n\n /* @conditional-compile-remove(media-access) */\n if (latestNotifications['capabilityUnmuteMicPresent']) {\n activeNotifications.push({\n type: 'capabilityUnmuteMicPresent',\n timestamp: latestNotifications['capabilityUnmuteMicPresent'].timestamp\n });\n }\n\n /* @conditional-compile-remove(media-access) */\n if (latestNotifications['capabilityUnmuteMicAbsent']) {\n activeNotifications.push({\n type: 'capabilityUnmuteMicAbsent',\n timestamp: latestNotifications['capabilityUnmuteMicAbsent'].timestamp\n });\n }\n\n return { activeErrorMessages: activeErrorMessages, activeNotifications: activeNotifications };\n }\n);\n\nconst appendActiveErrorIfDefined = (\n activeErrorMessages: ActiveNotification[],\n latestErrors: CallErrors,\n target: CallErrorTarget,\n activeErrorType: NotificationType\n): void => {\n if (latestErrors[target] === undefined) {\n return;\n }\n activeErrorMessages.push({\n type: activeErrorType,\n timestamp: latestErrors[target].timestamp\n });\n};\n\nconst appendMuteByOthersNotificationTrampoline = (\n activeErrorMessages: ActiveNotification[],\n latestErrors: CallErrors,\n latestNotifications?: undefined | /* @conditional-compile-remove(media-access) */ CallNotifications\n): void => {\n /* @conditional-compile-remove(media-access) */\n if (\n latestNotifications &&\n !latestNotifications['capabilityUnmuteMicAbsent'] &&\n !latestNotifications['capabilityUnmuteMicPresent']\n ) {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.mutedByOthers', 'mutedByRemoteParticipant');\n }\n /* @conditional-compile-remove(media-access) */\n return;\n\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.mutedByOthers', 'mutedByRemoteParticipant');\n};\n"]}
@@ -15,7 +15,7 @@ export declare const _videoGalleryRemoteParticipantsMemo: _VideoGalleryRemotePar
15
15
  /** @private */
16
16
  export declare const convertRemoteParticipantToVideoGalleryRemoteParticipant: (userId: string, isMuted: boolean, isSpeaking: boolean, videoStreams: {
17
17
  [key: number]: RemoteVideoStreamState;
18
- }, state: ParticipantConnectionState, displayName?: string, raisedHand?: RaisedHandState, contentSharingStream?: HTMLElement, reaction?: Reaction, spotlight?: Spotlight, signalStrength?: number, mediaAccess?: undefined | /* @conditional-compile-remove(media-access) */ MediaAccess) => VideoGalleryRemoteParticipant;
18
+ }, state: ParticipantConnectionState, displayName?: string, raisedHand?: RaisedHandState, contentSharingStream?: HTMLElement, reaction?: Reaction, spotlight?: Spotlight, signalStrength?: number, mediaAccess?: undefined | /* @conditional-compile-remove(media-access) */ MediaAccess, role?: undefined | /* @conditional-compile-remove(media-access) */ ParticipantRole) => VideoGalleryRemoteParticipant;
19
19
  /** @private */
20
20
  export declare const memoizeLocalParticipant: (this: any, identifier: any, displayName: any, isMuted: any, isScreenSharingOn: any, localVideoStream: any, localScreenSharingStream: any, role: any, raisedHand: any, reaction: any, localSpotlight: any, capabilities: any) => {
21
21
  userId: any;
@@ -37,23 +37,27 @@ export const _videoGalleryRemoteParticipantsMemo = (remoteParticipants, isHideAt
37
37
  /* @conditional-compile-remove(remote-ufd) */
38
38
  Math.max(((_c = (_b = (_a = participant.diagnostics) === null || _a === void 0 ? void 0 : _a.networkReceiveQuality) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : 0), ((_f = (_e = (_d = participant.diagnostics) === null || _d === void 0 ? void 0 : _d.networkSendQuality) === null || _e === void 0 ? void 0 : _e.value) !== null && _f !== void 0 ? _f : 0)),
39
39
  /* @conditional-compile-remove(media-access) */
40
- participant.mediaAccess);
40
+ participant.mediaAccess,
41
+ /* @conditional-compile-remove(media-access) */
42
+ participant.role);
41
43
  }));
42
44
  });
43
45
  };
44
46
  const memoizedAllConvertRemoteParticipant = memoizeFnAll((userId, isMuted, isSpeaking, videoStreams, state, displayName, raisedHand, contentSharingStream, reaction, spotlight,
45
47
  /* @conditional-compile-remove(remote-ufd) */
46
- signalStrength, mediaAccess) => {
48
+ signalStrength, mediaAccess, role) => {
47
49
  return convertRemoteParticipantToVideoGalleryRemoteParticipant(userId, isMuted, isSpeaking, videoStreams, state, displayName, raisedHand, contentSharingStream, reaction, spotlight,
48
50
  /* @conditional-compile-remove(remote-ufd) */
49
51
  signalStrength,
50
52
  /* @conditional-compile-remove(media-access) */
51
- mediaAccess);
53
+ mediaAccess,
54
+ /* @conditional-compile-remove(media-access) */
55
+ role);
52
56
  });
53
57
  /** @private */
54
58
  export const convertRemoteParticipantToVideoGalleryRemoteParticipant = (userId, isMuted, isSpeaking, videoStreams, state, displayName, raisedHand, contentSharingStream, reaction, spotlight,
55
59
  /* @conditional-compile-remove(remote-ufd) */
56
- signalStrength, mediaAccess) => {
60
+ signalStrength, mediaAccess, role) => {
57
61
  const rawVideoStreamsArray = Object.values(videoStreams);
58
62
  let videoStream = undefined;
59
63
  let screenShareStream = undefined;
@@ -92,7 +96,9 @@ signalStrength, mediaAccess) => {
92
96
  /* @conditional-compile-remove(remote-ufd) */
93
97
  signalStrength,
94
98
  /* @conditional-compile-remove(media-access) */
95
- mediaAccess
99
+ mediaAccess,
100
+ /* @conditional-compile-remove(media-access) */
101
+ role
96
102
  };
97
103
  };
98
104
  const convertRemoteVideoStreamToVideoGalleryStream = (stream) => {
@@ -1 +1 @@
1
- {"version":3,"file":"videoGalleryUtils.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/utils/videoGalleryUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EAAE,YAAY,EAAE,6BAA6B,EAAE,mCAAgC;AAQtF,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,wBAAwB,EAA8B,MAAM,aAAa,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAGtE,OAAO,EAAE,kCAAkC,EAAE,MAAM,gCAAgC,CAAC;AAGpF,gBAAgB;AAChB,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,gBAAuC,EAAwB,EAAE;;IAC3G,OA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EAAE,MAAA,wBAAwB,aAAxB,wBAAwB,uBAAxB,wBAAwB,CAAE,IAAI,0CAAE,MAAM;SACtD;QACD,IAAI;QACJ,UAAU,EAAE,UAAU;QACtB,QAAQ;QACR,SAAS,EAAE,cAAc;QACzB,YAAY;QACZ,+CAA+C;QAC/C,WAAW,EAAE;YACX,gBAAgB,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,SAAS,CAAC,SAAS;YACnD,gBAAgB,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,CAAC,SAAS;SACtD;KACF,CAAC,CAAA;CAAA,CACH,CAAC;AAEF,eAAe;AACf,MAAM,CAAC,MAAM,gCAAgC,GAAG,UAAU,CAAC,CAAC,uBAAuB,EAAE,EAAE,CACrF,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,GAAG,CAAC,CAAC,CAAyB,EAAE,EAAE,CAAC,6BAA6B,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CACzG,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DominantSpeakersInfo } from '@azure/communication-calling';\nimport { SpotlightedParticipant } from '@azure/communication-calling';\nimport { ParticipantRole } from '@azure/communication-calling';\nimport { memoizeFnAll, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { RemoteParticipantState, RemoteVideoStreamState } from '@internal/calling-stateful-client';\nimport {\n VideoGalleryRemoteParticipant,\n VideoGalleryStream,\n /* @conditional-compile-remove(media-access) */\n MediaAccess\n} from '@internal/react-components';\nimport memoizeOne from 'memoize-one';\nimport { _convertParticipantState, ParticipantConnectionState } from './callUtils';\nimport { maskDisplayNameWithRole } from './callUtils';\nimport { checkIsSpeaking } from './SelectorUtils';\nimport { isPhoneNumberIdentifier } from '@azure/communication-common';\nimport { RaisedHandState } from '@internal/calling-stateful-client';\nimport { Reaction } from '@internal/react-components';\nimport { memoizedConvertToVideoTileReaction } from './participantListSelectorUtils';\nimport { Spotlight } from '@internal/react-components';\n\n/** @internal */\nexport const _dominantSpeakersWithFlatId = (dominantSpeakers?: DominantSpeakersInfo): undefined | string[] => {\n return dominantSpeakers?.speakersList?.map(toFlatCommunicationIdentifier);\n};\n\n/** @internal */\nexport type _VideoGalleryRemoteParticipantsMemoFn = (\n remoteParticipants: RemoteParticipantState[] | undefined,\n isHideAttendeeNamesEnabled?: boolean,\n localUserRole?: ParticipantRole\n) => VideoGalleryRemoteParticipant[];\n\n/** @internal */\nexport const _videoGalleryRemoteParticipantsMemo: _VideoGalleryRemoteParticipantsMemoFn = (\n remoteParticipants: RemoteParticipantState[] | undefined,\n isHideAttendeeNamesEnabled?: boolean,\n localUserRole?\n): VideoGalleryRemoteParticipant[] => {\n if (!remoteParticipants) {\n return [];\n }\n\n return memoizedAllConvertRemoteParticipant((memoizedFn) => {\n return (\n Object.values(remoteParticipants)\n /**\n * hiding participants who are inLobby, idle, or connecting in ACS clients till we can admit users through ACS clients.\n * phone users will be in the connecting state until they are connected to the call.\n */\n .filter((participant: RemoteParticipantState) => {\n return (\n !['InLobby', 'Idle', 'Connecting', 'Disconnected'].includes(participant.state) ||\n isPhoneNumberIdentifier(participant.identifier)\n );\n })\n .map((participant: RemoteParticipantState) => {\n const state = _convertParticipantState(participant);\n const displayName = maskDisplayNameWithRole(\n participant.displayName,\n localUserRole,\n participant.role,\n isHideAttendeeNamesEnabled\n );\n const remoteParticipantReaction = memoizedConvertToVideoTileReaction(participant.reactionState);\n const spotlight = participant.spotlight;\n return memoizedFn(\n toFlatCommunicationIdentifier(participant.identifier),\n participant.isMuted,\n checkIsSpeaking(participant),\n participant.videoStreams,\n state,\n displayName,\n participant.raisedHand,\n participant.contentSharingStream,\n remoteParticipantReaction,\n spotlight,\n /* @conditional-compile-remove(remote-ufd) */\n Math.max(\n (participant.diagnostics?.networkReceiveQuality?.value ?? 0) as number,\n (participant.diagnostics?.networkSendQuality?.value ?? 0) as number\n ),\n /* @conditional-compile-remove(media-access) */\n participant.mediaAccess\n );\n })\n );\n });\n};\n\nconst memoizedAllConvertRemoteParticipant = memoizeFnAll(\n (\n userId: string,\n isMuted: boolean,\n isSpeaking: boolean,\n videoStreams: { [key: number]: RemoteVideoStreamState },\n state: ParticipantConnectionState,\n displayName?: string,\n raisedHand?: RaisedHandState,\n contentSharingStream?: HTMLElement,\n reaction?: Reaction,\n spotlight?: Spotlight,\n /* @conditional-compile-remove(remote-ufd) */\n signalStrength?: number,\n mediaAccess?: undefined | /* @conditional-compile-remove(media-access) */ MediaAccess\n ): VideoGalleryRemoteParticipant => {\n return convertRemoteParticipantToVideoGalleryRemoteParticipant(\n userId,\n isMuted,\n isSpeaking,\n videoStreams,\n state,\n displayName,\n raisedHand,\n contentSharingStream,\n reaction,\n spotlight,\n /* @conditional-compile-remove(remote-ufd) */\n signalStrength,\n /* @conditional-compile-remove(media-access) */\n mediaAccess\n );\n }\n);\n\n/** @private */\nexport const convertRemoteParticipantToVideoGalleryRemoteParticipant = (\n userId: string,\n isMuted: boolean,\n isSpeaking: boolean,\n videoStreams: { [key: number]: RemoteVideoStreamState },\n state: ParticipantConnectionState,\n displayName?: string,\n raisedHand?: RaisedHandState,\n contentSharingStream?: HTMLElement,\n reaction?: Reaction,\n spotlight?: Spotlight,\n /* @conditional-compile-remove(remote-ufd) */\n signalStrength?: number,\n mediaAccess?: undefined | /* @conditional-compile-remove(media-access) */ MediaAccess\n): VideoGalleryRemoteParticipant => {\n const rawVideoStreamsArray = Object.values(videoStreams);\n let videoStream: VideoGalleryStream | undefined = undefined;\n let screenShareStream: VideoGalleryStream | undefined = undefined;\n\n /**\n * There is a bug from the calling sdk where if a user leaves and rejoins immediately\n * it adds 2 more potential streams this remote participant can use. The old 2 streams\n * still show as available and that is how we got a frozen stream in this case. The stopgap\n * until streams accurately reflect their availability is to always prioritize the latest streams of a certain type\n * e.g findLast instead of find\n */\n const sdkRemoteVideoStream =\n Object.values(rawVideoStreamsArray).findLast((i) => i.mediaStreamType === 'Video' && i.isAvailable) ||\n Object.values(rawVideoStreamsArray).findLast((i) => i.mediaStreamType === 'Video');\n\n const sdkScreenShareStream =\n Object.values(rawVideoStreamsArray).findLast((i) => i.mediaStreamType === 'ScreenSharing' && i.isAvailable) ||\n Object.values(rawVideoStreamsArray).findLast((i) => i.mediaStreamType === 'ScreenSharing');\n\n if (sdkRemoteVideoStream) {\n videoStream = convertRemoteVideoStreamToVideoGalleryStream(sdkRemoteVideoStream);\n }\n if (sdkScreenShareStream) {\n screenShareStream = convertRemoteVideoStreamToVideoGalleryStream(sdkScreenShareStream);\n }\n\n if (contentSharingStream) {\n screenShareStream = convertRemoteContentSharingStreamToVideoGalleryStream(contentSharingStream);\n }\n\n return {\n userId,\n displayName,\n isMuted,\n isSpeaking,\n videoStream,\n screenShareStream,\n isScreenSharingOn: screenShareStream !== undefined && screenShareStream.isAvailable,\n state,\n raisedHand,\n reaction,\n spotlight,\n /* @conditional-compile-remove(remote-ufd) */\n signalStrength,\n /* @conditional-compile-remove(media-access) */\n mediaAccess\n };\n};\n\nconst convertRemoteVideoStreamToVideoGalleryStream = (stream: RemoteVideoStreamState): VideoGalleryStream => {\n return {\n id: stream.id,\n isAvailable: stream.isAvailable,\n isReceiving: stream.isReceiving,\n isMirrored: stream.view?.isMirrored,\n renderElement: stream.view?.target,\n scalingMode: stream.view?.scalingMode,\n streamSize: stream.streamSize\n };\n};\n\nconst convertRemoteContentSharingStreamToVideoGalleryStream = (stream: HTMLElement): VideoGalleryStream => {\n return {\n isAvailable: !!stream,\n isReceiving: true,\n isMirrored: false,\n renderElement: stream\n };\n};\n\n/** @private */\nexport const memoizeLocalParticipant = memoizeOne(\n (\n identifier,\n displayName,\n isMuted,\n isScreenSharingOn,\n localVideoStream,\n localScreenSharingStream,\n role,\n raisedHand,\n reaction,\n localSpotlight,\n capabilities\n ) => ({\n userId: identifier,\n displayName: displayName ?? '',\n isMuted: isMuted,\n isScreenSharingOn: isScreenSharingOn,\n videoStream: {\n isAvailable: !!localVideoStream,\n isMirrored: localVideoStream?.view?.isMirrored,\n renderElement: localVideoStream?.view?.target\n },\n screenShareStream: {\n isAvailable: !!localScreenSharingStream,\n renderElement: localScreenSharingStream?.view?.target\n },\n role,\n raisedHand: raisedHand,\n reaction,\n spotlight: localSpotlight,\n capabilities,\n /* @conditional-compile-remove(media-access) */\n mediaAccess: {\n isAudioPermitted: capabilities?.unmuteMic.isPresent,\n isVideoPermitted: capabilities?.turnVideoOn.isPresent\n }\n })\n);\n\n/** @private */\nexport const memoizeSpotlightedParticipantIds = memoizeOne((spotlightedParticipants) =>\n spotlightedParticipants?.map((p: SpotlightedParticipant) => toFlatCommunicationIdentifier(p.identifier))\n);\n"]}
1
+ {"version":3,"file":"videoGalleryUtils.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/utils/videoGalleryUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EAAE,YAAY,EAAE,6BAA6B,EAAE,mCAAgC;AAQtF,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,wBAAwB,EAA8B,MAAM,aAAa,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAGtE,OAAO,EAAE,kCAAkC,EAAE,MAAM,gCAAgC,CAAC;AAGpF,gBAAgB;AAChB,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,gBAAuC,EAAwB,EAAE;;IAC3G,OAAO,MAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,YAAY,0CAAE,GAAG,CAAC,6BAA6B,CAAC,CAAC;AAC5E,CAAC,CAAC;AASF,gBAAgB;AAChB,MAAM,CAAC,MAAM,mCAAmC,GAA0C,CACxF,kBAAwD,EACxD,0BAAoC,EACpC,aAAc,EACmB,EAA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AAE,UAAU;QACtB,QAAQ;QACR,SAAS,EAAE,cAAc;QACzB,YAAY;QACZ,+CAA+C;QAC/C,WAAW,EAAE;YACX,gBAAgB,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,SAAS,CAAC,SAAS;YACnD,gBAAgB,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,CAAC,SAAS;SACtD;KACF,CAAC,CAAA;CAAA,CACH,CAAC;AAEF,eAAe;AACf,MAAM,CAAC,MAAM,gCAAgC,GAAG,UAAU,CAAC,CAAC,uBAAuB,EAAE,EAAE,CACrF,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,GAAG,CAAC,CAAC,CAAyB,EAAE,EAAE,CAAC,6BAA6B,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CACzG,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DominantSpeakersInfo } from '@azure/communication-calling';\nimport { SpotlightedParticipant } from '@azure/communication-calling';\nimport { ParticipantRole } from '@azure/communication-calling';\nimport { memoizeFnAll, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { RemoteParticipantState, RemoteVideoStreamState } from '@internal/calling-stateful-client';\nimport {\n VideoGalleryRemoteParticipant,\n VideoGalleryStream,\n /* @conditional-compile-remove(media-access) */\n MediaAccess\n} from '@internal/react-components';\nimport memoizeOne from 'memoize-one';\nimport { _convertParticipantState, ParticipantConnectionState } from './callUtils';\nimport { maskDisplayNameWithRole } from './callUtils';\nimport { checkIsSpeaking } from './SelectorUtils';\nimport { isPhoneNumberIdentifier } from '@azure/communication-common';\nimport { RaisedHandState } from '@internal/calling-stateful-client';\nimport { Reaction } from '@internal/react-components';\nimport { memoizedConvertToVideoTileReaction } from './participantListSelectorUtils';\nimport { Spotlight } from '@internal/react-components';\n\n/** @internal */\nexport const _dominantSpeakersWithFlatId = (dominantSpeakers?: DominantSpeakersInfo): undefined | string[] => {\n return dominantSpeakers?.speakersList?.map(toFlatCommunicationIdentifier);\n};\n\n/** @internal */\nexport type _VideoGalleryRemoteParticipantsMemoFn = (\n remoteParticipants: RemoteParticipantState[] | undefined,\n isHideAttendeeNamesEnabled?: boolean,\n localUserRole?: ParticipantRole\n) => VideoGalleryRemoteParticipant[];\n\n/** @internal */\nexport const _videoGalleryRemoteParticipantsMemo: _VideoGalleryRemoteParticipantsMemoFn = (\n remoteParticipants: RemoteParticipantState[] | undefined,\n isHideAttendeeNamesEnabled?: boolean,\n localUserRole?\n): VideoGalleryRemoteParticipant[] => {\n if (!remoteParticipants) {\n return [];\n }\n\n return memoizedAllConvertRemoteParticipant((memoizedFn) => {\n return (\n Object.values(remoteParticipants)\n /**\n * hiding participants who are inLobby, idle, or connecting in ACS clients till we can admit users through ACS clients.\n * phone users will be in the connecting state until they are connected to the call.\n */\n .filter((participant: RemoteParticipantState) => {\n return (\n !['InLobby', 'Idle', 'Connecting', 'Disconnected'].includes(participant.state) ||\n isPhoneNumberIdentifier(participant.identifier)\n );\n })\n .map((participant: RemoteParticipantState) => {\n const state = _convertParticipantState(participant);\n const displayName = maskDisplayNameWithRole(\n participant.displayName,\n localUserRole,\n participant.role,\n isHideAttendeeNamesEnabled\n );\n const remoteParticipantReaction = memoizedConvertToVideoTileReaction(participant.reactionState);\n const spotlight = participant.spotlight;\n return memoizedFn(\n toFlatCommunicationIdentifier(participant.identifier),\n participant.isMuted,\n checkIsSpeaking(participant),\n participant.videoStreams,\n state,\n displayName,\n participant.raisedHand,\n participant.contentSharingStream,\n remoteParticipantReaction,\n spotlight,\n /* @conditional-compile-remove(remote-ufd) */\n Math.max(\n (participant.diagnostics?.networkReceiveQuality?.value ?? 0) as number,\n (participant.diagnostics?.networkSendQuality?.value ?? 0) as number\n ),\n /* @conditional-compile-remove(media-access) */\n participant.mediaAccess,\n /* @conditional-compile-remove(media-access) */\n participant.role\n );\n })\n );\n });\n};\n\nconst memoizedAllConvertRemoteParticipant = memoizeFnAll(\n (\n userId: string,\n isMuted: boolean,\n isSpeaking: boolean,\n videoStreams: { [key: number]: RemoteVideoStreamState },\n state: ParticipantConnectionState,\n displayName?: string,\n raisedHand?: RaisedHandState,\n contentSharingStream?: HTMLElement,\n reaction?: Reaction,\n spotlight?: Spotlight,\n /* @conditional-compile-remove(remote-ufd) */\n signalStrength?: number,\n mediaAccess?: undefined | /* @conditional-compile-remove(media-access) */ MediaAccess,\n role?: undefined | /* @conditional-compile-remove(media-access) */ ParticipantRole\n ): VideoGalleryRemoteParticipant => {\n return convertRemoteParticipantToVideoGalleryRemoteParticipant(\n userId,\n isMuted,\n isSpeaking,\n videoStreams,\n state,\n displayName,\n raisedHand,\n contentSharingStream,\n reaction,\n spotlight,\n /* @conditional-compile-remove(remote-ufd) */\n signalStrength,\n /* @conditional-compile-remove(media-access) */\n mediaAccess,\n /* @conditional-compile-remove(media-access) */\n role\n );\n }\n);\n\n/** @private */\nexport const convertRemoteParticipantToVideoGalleryRemoteParticipant = (\n userId: string,\n isMuted: boolean,\n isSpeaking: boolean,\n videoStreams: { [key: number]: RemoteVideoStreamState },\n state: ParticipantConnectionState,\n displayName?: string,\n raisedHand?: RaisedHandState,\n contentSharingStream?: HTMLElement,\n reaction?: Reaction,\n spotlight?: Spotlight,\n /* @conditional-compile-remove(remote-ufd) */\n signalStrength?: number,\n mediaAccess?: undefined | /* @conditional-compile-remove(media-access) */ MediaAccess,\n role?: undefined | /* @conditional-compile-remove(media-access) */ ParticipantRole\n): VideoGalleryRemoteParticipant => {\n const rawVideoStreamsArray = Object.values(videoStreams);\n let videoStream: VideoGalleryStream | undefined = undefined;\n let screenShareStream: VideoGalleryStream | undefined = undefined;\n\n /**\n * There is a bug from the calling sdk where if a user leaves and rejoins immediately\n * it adds 2 more potential streams this remote participant can use. The old 2 streams\n * still show as available and that is how we got a frozen stream in this case. The stopgap\n * until streams accurately reflect their availability is to always prioritize the latest streams of a certain type\n * e.g findLast instead of find\n */\n const sdkRemoteVideoStream =\n Object.values(rawVideoStreamsArray).findLast((i) => i.mediaStreamType === 'Video' && i.isAvailable) ||\n Object.values(rawVideoStreamsArray).findLast((i) => i.mediaStreamType === 'Video');\n\n const sdkScreenShareStream =\n Object.values(rawVideoStreamsArray).findLast((i) => i.mediaStreamType === 'ScreenSharing' && i.isAvailable) ||\n Object.values(rawVideoStreamsArray).findLast((i) => i.mediaStreamType === 'ScreenSharing');\n\n if (sdkRemoteVideoStream) {\n videoStream = convertRemoteVideoStreamToVideoGalleryStream(sdkRemoteVideoStream);\n }\n if (sdkScreenShareStream) {\n screenShareStream = convertRemoteVideoStreamToVideoGalleryStream(sdkScreenShareStream);\n }\n\n if (contentSharingStream) {\n screenShareStream = convertRemoteContentSharingStreamToVideoGalleryStream(contentSharingStream);\n }\n\n return {\n userId,\n displayName,\n isMuted,\n isSpeaking,\n videoStream,\n screenShareStream,\n isScreenSharingOn: screenShareStream !== undefined && screenShareStream.isAvailable,\n state,\n raisedHand,\n reaction,\n spotlight,\n /* @conditional-compile-remove(remote-ufd) */\n signalStrength,\n /* @conditional-compile-remove(media-access) */\n mediaAccess,\n /* @conditional-compile-remove(media-access) */\n role\n };\n};\n\nconst convertRemoteVideoStreamToVideoGalleryStream = (stream: RemoteVideoStreamState): VideoGalleryStream => {\n return {\n id: stream.id,\n isAvailable: stream.isAvailable,\n isReceiving: stream.isReceiving,\n isMirrored: stream.view?.isMirrored,\n renderElement: stream.view?.target,\n scalingMode: stream.view?.scalingMode,\n streamSize: stream.streamSize\n };\n};\n\nconst convertRemoteContentSharingStreamToVideoGalleryStream = (stream: HTMLElement): VideoGalleryStream => {\n return {\n isAvailable: !!stream,\n isReceiving: true,\n isMirrored: false,\n renderElement: stream\n };\n};\n\n/** @private */\nexport const memoizeLocalParticipant = memoizeOne(\n (\n identifier,\n displayName,\n isMuted,\n isScreenSharingOn,\n localVideoStream,\n localScreenSharingStream,\n role,\n raisedHand,\n reaction,\n localSpotlight,\n capabilities\n ) => ({\n userId: identifier,\n displayName: displayName ?? '',\n isMuted: isMuted,\n isScreenSharingOn: isScreenSharingOn,\n videoStream: {\n isAvailable: !!localVideoStream,\n isMirrored: localVideoStream?.view?.isMirrored,\n renderElement: localVideoStream?.view?.target\n },\n screenShareStream: {\n isAvailable: !!localScreenSharingStream,\n renderElement: localScreenSharingStream?.view?.target\n },\n role,\n raisedHand: raisedHand,\n reaction,\n spotlight: localSpotlight,\n capabilities,\n /* @conditional-compile-remove(media-access) */\n mediaAccess: {\n isAudioPermitted: capabilities?.unmuteMic.isPresent,\n isVideoPermitted: capabilities?.turnVideoOn.isPresent\n }\n })\n);\n\n/** @private */\nexport const memoizeSpotlightedParticipantIds = memoizeOne((spotlightedParticipants) =>\n spotlightedParticipants?.map((p: SpotlightedParticipant) => toFlatCommunicationIdentifier(p.identifier))\n);\n"]}
@@ -48,7 +48,13 @@ export const videoGallerySelector = createSelector([
48
48
  const spotlightedParticipantIds = memoizeSpotlightedParticipantIds(spotlightCallFeature === null || spotlightCallFeature === void 0 ? void 0 : spotlightCallFeature.spotlightedParticipants);
49
49
  return {
50
50
  screenShareParticipant: screenShareRemoteParticipant
51
- ? convertRemoteParticipantToVideoGalleryRemoteParticipant(toFlatCommunicationIdentifier(screenShareRemoteParticipant.identifier), screenShareRemoteParticipant.isMuted, checkIsSpeaking(screenShareRemoteParticipant), screenShareRemoteParticipant.videoStreams, screenShareRemoteParticipant.state, screenShareRemoteParticipant.displayName, screenShareRemoteParticipant.raisedHand, screenShareRemoteParticipant.contentSharingStream, undefined, screenShareRemoteParticipant.spotlight)
51
+ ? convertRemoteParticipantToVideoGalleryRemoteParticipant(toFlatCommunicationIdentifier(screenShareRemoteParticipant.identifier), screenShareRemoteParticipant.isMuted, checkIsSpeaking(screenShareRemoteParticipant), screenShareRemoteParticipant.videoStreams, screenShareRemoteParticipant.state, screenShareRemoteParticipant.displayName, screenShareRemoteParticipant.raisedHand, screenShareRemoteParticipant.contentSharingStream, undefined, screenShareRemoteParticipant.spotlight,
52
+ /* @conditional-compile-remove(media-access) */
53
+ undefined,
54
+ /* @conditional-compile-remove(media-access) */
55
+ screenShareRemoteParticipant.mediaAccess,
56
+ /* @conditional-compile-remove(media-access) */
57
+ role)
52
58
  : undefined,
53
59
  localParticipant: memoizeLocalParticipant(identifier, displayName, isMuted, isScreenSharingOn, localVideoStream, localScreenSharingStream, role, raisedHand, localParticipantReactionState, spotlightCallFeature === null || spotlightCallFeature === void 0 ? void 0 : spotlightCallFeature.localParticipantSpotlight, capabilities),
54
60
  remoteParticipants: _videoGalleryRemoteParticipantsMemo(_updateUserDisplayNames(remoteParticipants ? Object.values(remoteParticipants) : noRemoteParticipants), isHideAttendeeNamesEnabled, role),
@@ -1 +1 @@
1
- {"version":3,"file":"videoGallerySelector.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/videoGallerySelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAGxE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAEL,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,OAAO,EACP,+BAA+B,EAChC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,mCAAmC,EACnC,2BAA2B,EAC3B,uDAAuD,EACvD,uBAAuB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,gCAAgC,EAAE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B;QAClD,0BAA0B,EAAE,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,0BAA0B;KAC7E,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { CallClientState, RemoteParticipantState } from '@internal/calling-stateful-client';\nimport { VideoGalleryRemoteParticipant, VideoGalleryLocalParticipant } from '@internal/react-components';\nimport { createSelector } from 'reselect';\nimport {\n CallingBaseSelectorProps,\n getDisplayName,\n getDominantSpeakers,\n getIdentifier,\n getIsMuted,\n getIsScreenSharingOn,\n getLocalVideoStreams,\n getRole,\n getScreenShareRemoteParticipant\n} from './baseSelectors';\nimport { isHideAttendeeNamesEnabled } from './baseSelectors';\nimport { getOptimalVideoCount } from './baseSelectors';\nimport { _updateUserDisplayNames } from './utils/callUtils';\nimport { checkIsSpeaking } from './utils/SelectorUtils';\nimport {\n _videoGalleryRemoteParticipantsMemo,\n _dominantSpeakersWithFlatId,\n convertRemoteParticipantToVideoGalleryRemoteParticipant,\n memoizeLocalParticipant\n} from './utils/videoGalleryUtils';\nimport { memoizeSpotlightedParticipantIds } from './utils/videoGalleryUtils';\nimport { getLocalParticipantRaisedHand } from './baseSelectors';\nimport { getLocalParticipantReactionState } from './baseSelectors';\nimport { memoizedConvertToVideoTileReaction } from './utils/participantListSelectorUtils';\nimport { getRemoteParticipantsExcludingConsumers } from './getRemoteParticipantsExcludingConsumers';\nimport { getSpotlightCallFeature, getCapabilities } from './baseSelectors';\n\n/**\n * Selector type for {@link VideoGallery} component.\n *\n * @public\n */\nexport type VideoGallerySelector = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n) => {\n screenShareParticipant?: VideoGalleryRemoteParticipant;\n localParticipant: VideoGalleryLocalParticipant;\n remoteParticipants: VideoGalleryRemoteParticipant[];\n dominantSpeakers?: string[];\n optimalVideoCount?: number;\n spotlightedParticipants?: string[];\n maxParticipantsToSpotlight?: number;\n};\n\n/**\n * Provides data attributes to {@link VideoGallery} component.\n * @public\n */\nexport const videoGallerySelector: VideoGallerySelector = createSelector(\n [\n getScreenShareRemoteParticipant,\n getRemoteParticipantsExcludingConsumers,\n getLocalVideoStreams,\n getIsMuted,\n getIsScreenSharingOn,\n getDisplayName,\n getIdentifier,\n getDominantSpeakers,\n getOptimalVideoCount,\n getRole,\n getLocalParticipantRaisedHand,\n isHideAttendeeNamesEnabled,\n getLocalParticipantReactionState,\n getSpotlightCallFeature,\n getCapabilities\n ],\n (\n screenShareRemoteParticipantId,\n remoteParticipants,\n localVideoStreams,\n isMuted,\n isScreenSharingOn,\n displayName: string | undefined,\n identifier: string,\n dominantSpeakers,\n optimalVideoCount,\n role,\n raisedHand,\n isHideAttendeeNamesEnabled,\n localParticipantReaction,\n spotlightCallFeature,\n capabilities\n ) => {\n const screenShareRemoteParticipant =\n screenShareRemoteParticipantId && remoteParticipants\n ? remoteParticipants[screenShareRemoteParticipantId]\n : undefined;\n const localVideoStream = localVideoStreams?.find((i) => i.mediaStreamType === 'Video');\n const localScreenSharingStream = localVideoStreams?.find((i) => i.mediaStreamType === 'ScreenSharing');\n const dominantSpeakerIds = _dominantSpeakersWithFlatId(dominantSpeakers);\n const dominantSpeakersMap: Record<string, number> = {};\n dominantSpeakerIds?.forEach((speaker, idx) => (dominantSpeakersMap[speaker] = idx));\n const noRemoteParticipants: RemoteParticipantState[] = [];\n const localParticipantReactionState = memoizedConvertToVideoTileReaction(localParticipantReaction);\n const spotlightedParticipantIds = memoizeSpotlightedParticipantIds(spotlightCallFeature?.spotlightedParticipants);\n\n return {\n screenShareParticipant: screenShareRemoteParticipant\n ? convertRemoteParticipantToVideoGalleryRemoteParticipant(\n toFlatCommunicationIdentifier(screenShareRemoteParticipant.identifier),\n screenShareRemoteParticipant.isMuted,\n checkIsSpeaking(screenShareRemoteParticipant),\n screenShareRemoteParticipant.videoStreams,\n screenShareRemoteParticipant.state,\n screenShareRemoteParticipant.displayName,\n screenShareRemoteParticipant.raisedHand,\n screenShareRemoteParticipant.contentSharingStream,\n undefined,\n screenShareRemoteParticipant.spotlight\n )\n : undefined,\n localParticipant: memoizeLocalParticipant(\n identifier,\n displayName,\n isMuted,\n isScreenSharingOn,\n localVideoStream,\n localScreenSharingStream,\n role,\n raisedHand,\n localParticipantReactionState,\n spotlightCallFeature?.localParticipantSpotlight,\n capabilities\n ),\n remoteParticipants: _videoGalleryRemoteParticipantsMemo(\n _updateUserDisplayNames(remoteParticipants ? Object.values(remoteParticipants) : noRemoteParticipants),\n isHideAttendeeNamesEnabled,\n role\n ),\n dominantSpeakers: dominantSpeakerIds,\n maxRemoteVideoStreams: optimalVideoCount,\n spotlightedParticipants: spotlightedParticipantIds,\n maxParticipantsToSpotlight: spotlightCallFeature?.maxParticipantsToSpotlight\n };\n }\n);\n"]}
1
+ {"version":3,"file":"videoGallerySelector.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/videoGallerySelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAGxE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAEL,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,OAAO,EACP,+BAA+B,EAChC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,mCAAmC,EACnC,2BAA2B,EAC3B,uDAAuD,EACvD,uBAAuB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gCAAgC,EAAE,MAA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AAC,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,EACtG,0BAA0B,EAC1B,IAAI,CACL;QACD,gBAAgB,EAAE,kBAAkB;QACpC,qBAAqB,EAAE,iBAAiB;QACxC,uBAAuB,EAAE,yBAAyB;QAClD,0BAA0B,EAAE,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,0BAA0B;KAC7E,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { CallClientState, RemoteParticipantState } from '@internal/calling-stateful-client';\nimport { VideoGalleryRemoteParticipant, VideoGalleryLocalParticipant } from '@internal/react-components';\nimport { createSelector } from 'reselect';\nimport {\n CallingBaseSelectorProps,\n getDisplayName,\n getDominantSpeakers,\n getIdentifier,\n getIsMuted,\n getIsScreenSharingOn,\n getLocalVideoStreams,\n getRole,\n getScreenShareRemoteParticipant\n} from './baseSelectors';\nimport { isHideAttendeeNamesEnabled } from './baseSelectors';\nimport { getOptimalVideoCount } from './baseSelectors';\nimport { _updateUserDisplayNames } from './utils/callUtils';\nimport { checkIsSpeaking } from './utils/SelectorUtils';\nimport {\n _videoGalleryRemoteParticipantsMemo,\n _dominantSpeakersWithFlatId,\n convertRemoteParticipantToVideoGalleryRemoteParticipant,\n memoizeLocalParticipant\n} from './utils/videoGalleryUtils';\nimport { memoizeSpotlightedParticipantIds } from './utils/videoGalleryUtils';\nimport { getLocalParticipantRaisedHand } from './baseSelectors';\nimport { getLocalParticipantReactionState } from './baseSelectors';\nimport { memoizedConvertToVideoTileReaction } from './utils/participantListSelectorUtils';\nimport { getRemoteParticipantsExcludingConsumers } from './getRemoteParticipantsExcludingConsumers';\nimport { getSpotlightCallFeature, getCapabilities } from './baseSelectors';\n\n/**\n * Selector type for {@link VideoGallery} component.\n *\n * @public\n */\nexport type VideoGallerySelector = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n) => {\n screenShareParticipant?: VideoGalleryRemoteParticipant;\n localParticipant: VideoGalleryLocalParticipant;\n remoteParticipants: VideoGalleryRemoteParticipant[];\n dominantSpeakers?: string[];\n optimalVideoCount?: number;\n spotlightedParticipants?: string[];\n maxParticipantsToSpotlight?: number;\n};\n\n/**\n * Provides data attributes to {@link VideoGallery} component.\n * @public\n */\nexport const videoGallerySelector: VideoGallerySelector = createSelector(\n [\n getScreenShareRemoteParticipant,\n getRemoteParticipantsExcludingConsumers,\n getLocalVideoStreams,\n getIsMuted,\n getIsScreenSharingOn,\n getDisplayName,\n getIdentifier,\n getDominantSpeakers,\n getOptimalVideoCount,\n getRole,\n getLocalParticipantRaisedHand,\n isHideAttendeeNamesEnabled,\n getLocalParticipantReactionState,\n getSpotlightCallFeature,\n getCapabilities\n ],\n (\n screenShareRemoteParticipantId,\n remoteParticipants,\n localVideoStreams,\n isMuted,\n isScreenSharingOn,\n displayName: string | undefined,\n identifier: string,\n dominantSpeakers,\n optimalVideoCount,\n role,\n raisedHand,\n isHideAttendeeNamesEnabled,\n localParticipantReaction,\n spotlightCallFeature,\n capabilities\n ) => {\n const screenShareRemoteParticipant =\n screenShareRemoteParticipantId && remoteParticipants\n ? remoteParticipants[screenShareRemoteParticipantId]\n : undefined;\n const localVideoStream = localVideoStreams?.find((i) => i.mediaStreamType === 'Video');\n const localScreenSharingStream = localVideoStreams?.find((i) => i.mediaStreamType === 'ScreenSharing');\n const dominantSpeakerIds = _dominantSpeakersWithFlatId(dominantSpeakers);\n const dominantSpeakersMap: Record<string, number> = {};\n dominantSpeakerIds?.forEach((speaker, idx) => (dominantSpeakersMap[speaker] = idx));\n const noRemoteParticipants: RemoteParticipantState[] = [];\n const localParticipantReactionState = memoizedConvertToVideoTileReaction(localParticipantReaction);\n const spotlightedParticipantIds = memoizeSpotlightedParticipantIds(spotlightCallFeature?.spotlightedParticipants);\n\n return {\n screenShareParticipant: screenShareRemoteParticipant\n ? convertRemoteParticipantToVideoGalleryRemoteParticipant(\n toFlatCommunicationIdentifier(screenShareRemoteParticipant.identifier),\n screenShareRemoteParticipant.isMuted,\n checkIsSpeaking(screenShareRemoteParticipant),\n screenShareRemoteParticipant.videoStreams,\n screenShareRemoteParticipant.state,\n screenShareRemoteParticipant.displayName,\n screenShareRemoteParticipant.raisedHand,\n screenShareRemoteParticipant.contentSharingStream,\n undefined,\n screenShareRemoteParticipant.spotlight,\n /* @conditional-compile-remove(media-access) */\n undefined,\n /* @conditional-compile-remove(media-access) */\n screenShareRemoteParticipant.mediaAccess,\n /* @conditional-compile-remove(media-access) */\n role\n )\n : undefined,\n localParticipant: memoizeLocalParticipant(\n identifier,\n displayName,\n isMuted,\n isScreenSharingOn,\n localVideoStream,\n localScreenSharingStream,\n role,\n raisedHand,\n localParticipantReactionState,\n spotlightCallFeature?.localParticipantSpotlight,\n capabilities\n ),\n remoteParticipants: _videoGalleryRemoteParticipantsMemo(\n _updateUserDisplayNames(remoteParticipants ? Object.values(remoteParticipants) : noRemoteParticipants),\n isHideAttendeeNamesEnabled,\n role\n ),\n dominantSpeakers: dominantSpeakerIds,\n maxRemoteVideoStreams: optimalVideoCount,\n spotlightedParticipants: spotlightedParticipantIds,\n maxParticipantsToSpotlight: spotlightCallFeature?.maxParticipantsToSpotlight\n };\n }\n);\n"]}
@@ -684,6 +684,10 @@ export interface CallState {
684
684
  * Proxy of {@link @azure/communication-calling#BreakoutRoomsFeature}.
685
685
  */
686
686
  breakoutRooms?: BreakoutRoomsState;
687
+ /**
688
+ * Proxy of {@link @azure/communication-calling#MediaAccessFeature}.
689
+ */
690
+ mediaAccess?: MediaAccessState;
687
691
  }
688
692
  /**
689
693
  * Transfer feature state
@@ -993,7 +997,7 @@ export interface CallNotification {
993
997
  timestamp: Date;
994
998
  }
995
999
  /** @public */
996
- export type NotificationTarget = 'assignedBreakoutRoomOpened' | 'assignedBreakoutRoomOpenedPromptJoin' | 'assignedBreakoutRoomChanged' | 'breakoutRoomJoined' | 'breakoutRoomClosingSoon';
1000
+ export type NotificationTarget = 'assignedBreakoutRoomOpened' | 'assignedBreakoutRoomOpenedPromptJoin' | 'assignedBreakoutRoomChanged' | 'breakoutRoomJoined' | 'breakoutRoomClosingSoon' | /* @conditional-compile-remove(media-access) */ 'capabilityTurnVideoOnPresent' | /* @conditional-compile-remove(media-access) */ 'capabilityTurnVideoOnAbsent' | /* @conditional-compile-remove(media-access) */ 'capabilityUnmuteMicPresent' | /* @conditional-compile-remove(media-access) */ 'capabilityUnmuteMicAbsent';
997
1001
  /**
998
1002
  * State only proxy for {@link @azure/communication-calling#DiagnosticsCallFeature}.
999
1003
  *