@azure/communication-react 1.24.0-alpha-202501291646 → 1.24.0-alpha-202501300015
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.
- package/dist/communication-react.d.ts +112 -5
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-Cq3nUCjN.js → ChatMessageComponentAsRichTextEditBox-B7usiRRs.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-Cq3nUCjN.js.map → ChatMessageComponentAsRichTextEditBox-B7usiRRs.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DX7BSYyk.js → RichTextSendBoxWrapper-BUOpEC0L.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DX7BSYyk.js.map → RichTextSendBoxWrapper-BUOpEC0L.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-8zA739Rz.js → index-BYO_RzRh.js} +490 -99
- package/dist/dist-cjs/communication-react/index-BYO_RzRh.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +11 -4
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +12 -2
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/captionsSelector.d.ts +9 -0
- package/dist/dist-esm/calling-component-bindings/src/captionsSelector.js +102 -5
- package/dist/dist-esm/calling-component-bindings/src/captionsSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +1 -0
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +8 -17
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js +7 -21
- package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +3 -11
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.d.ts +2 -3
- package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js +0 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.d.ts +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +1 -9
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +1 -7
- package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +61 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +5 -0
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js +110 -6
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +1 -0
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +9 -3
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.d.ts +6 -0
- package/dist/dist-esm/calling-stateful-client/src/Converter.js +12 -0
- package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/RealTimeTextSubscriber.d.ts +16 -0
- package/dist/dist-esm/calling-stateful-client/src/RealTimeTextSubscriber.js +25 -0
- package/dist/dist-esm/calling-stateful-client/src/RealTimeTextSubscriber.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -0
- package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +4 -4
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js +1 -1
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/StartRealTimeTextButton.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/StartRealTimeTextButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +4 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +5 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +20 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +22 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +23 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +4 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +9 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +12 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +4 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +16 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +10 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +6 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingCaptionsBanner.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/CallingCaptionsBanner.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingCaptionsBanner.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingRealTimeTextModal.d.ts +12 -0
- package/dist/dist-esm/react-composites/src/composites/common/CallingRealTimeTextModal.js +23 -0
- package/dist/dist-esm/react-composites/src/composites/common/CallingRealTimeTextModal.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +3 -0
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +27 -2
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.d.ts +3 -0
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +48 -0
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.d.ts +3 -0
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +36 -0
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.styles.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.d.ts +3 -0
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +1 -0
- package/package.json +1 -1
- package/dist/dist-cjs/communication-react/index-8zA739Rz.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"participantListSelector.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/participantListSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EACL,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,UAAU;AAEV,+CAA+C;AAC/C,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC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,CAAC;QAC3E,SAAS,EAAE,iBAAiB,CAAC,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,uBAAuB,EAAE,MAAM,CAAC;QACnF,+CAA+C;QAC/C,WAAW,EAAE;YACX,gBAAgB,EAAE,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,SAAS,EAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;YACnF,gBAAgB,EAAE,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,EAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;SACxF;KACF,CAAC,CAAC;IACH,0DAA0D;IAC1D,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;IAC/C,OAAO;QACL,YAAY,EAAE,YAAY;QAC1B,QAAQ,EAAE,MAAM;QAChB,0DAA0D;QAC1D,qBAAqB,EAAE,qBAAqB;KAC7C,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,kCAAkC,GAAG,CAAC,IAAa,EAAW,EAAE;IACpE,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,CAAC;AAC1E,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallClientState, RemoteParticipantState } from '@internal/calling-stateful-client';\nimport { createSelector } from 'reselect';\nimport {\n getIdentifier,\n getDisplayName,\n getIsScreenSharingOn,\n getIsMuted,\n CallingBaseSelectorProps,\n /* @conditional-compile-remove(media-access) */\n getCapabilities\n} from './baseSelectors';\nimport { getRole } from './baseSelectors';\nimport { isHideAttendeeNamesEnabled } from './baseSelectors';\nimport { CallParticipantListParticipant } from '@internal/react-components';\nimport { _convertParticipantState, _updateUserDisplayNames } from './utils/callUtils';\nimport { memoizedConvertAllremoteParticipants } from './utils/participantListSelectorUtils';\nimport { memoizedConvertToVideoTileReaction, memoizedSpotlight } from './utils/participantListSelectorUtils';\nimport { getLocalParticipantRaisedHand } from './baseSelectors';\nimport { getLocalParticipantReactionState } from './baseSelectors';\nimport { getSpotlightCallFeature } from './baseSelectors';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { getParticipantCount } from './baseSelectors';\nimport { isMicrosoftTeamsAppIdentifier, isPhoneNumberIdentifier } from '@azure/communication-common';\nimport { ParticipantRole, SpotlightedParticipant } from '@azure/communication-calling';\nimport { maskDisplayNameWithRole } from './utils/callUtils';\nimport { getRemoteParticipantsExcludingConsumers } from './getRemoteParticipantsExcludingConsumers';\n\nconst convertRemoteParticipantsToParticipantListParticipants = (\n remoteParticipants: RemoteParticipantState[],\n localUserCanRemoveOthers: boolean,\n isHideAttendeeNamesEnabled?: boolean,\n localUserRole?: ParticipantRole,\n spotlightedParticipants?: SpotlightedParticipant[]\n): CallParticipantListParticipant[] => {\n const conversionCallback = (\n memoizeFn: (...args: any[]) => CallParticipantListParticipant\n ): CallParticipantListParticipant[] => {\n return (\n remoteParticipants\n // Filter out MicrosoftBot participants\n .filter((participant: RemoteParticipantState) => {\n return !isMicrosoftTeamsAppIdentifier(participant.identifier);\n })\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) => {\n return (\n !['InLobby', 'Idle', 'Connecting', 'Disconnected'].includes(participant.state) ||\n isPhoneNumberIdentifier(participant.identifier)\n );\n })\n .map((participant: RemoteParticipantState) => {\n const isScreenSharing = Object.values(participant.videoStreams).some(\n (videoStream) => videoStream.mediaStreamType === 'ScreenSharing' && videoStream.isAvailable\n );\n /**\n * We want to check the participant to see if they are a PSTN participant joining the call\n * and mapping their state to be 'Ringing'\n */\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 = memoizedSpotlight(\n spotlightedParticipants,\n toFlatCommunicationIdentifier(participant.identifier)\n );\n\n return memoizeFn(\n toFlatCommunicationIdentifier(participant.identifier),\n displayName,\n state,\n participant.isMuted,\n isScreenSharing,\n participant.isSpeaking,\n participant.raisedHand,\n localUserCanRemoveOthers,\n remoteParticipantReaction,\n spotlight,\n /* @conditional-compile-remove(media-access) */\n participant.mediaAccess\n );\n })\n .sort((a, b) => {\n const nameA = a.displayName?.toLowerCase() || '';\n const nameB = b.displayName?.toLowerCase() || '';\n if (nameA < nameB) {\n return -1;\n } else if (nameA > nameB) {\n return 1;\n } else {\n return 0;\n }\n })\n );\n };\n return memoizedConvertAllremoteParticipants(conversionCallback);\n};\n\n/**\n * Selector type for {@link ParticipantList} component.\n *\n * @public\n */\nexport type ParticipantListSelector = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n) => {\n participants: CallParticipantListParticipant[];\n myUserId: string;\n /* @conditional-compile-remove(total-participant-count) */\n totalParticipantCount?: number;\n};\n\n/**\n * Selects data that drives {@link ParticipantList} component.\n *\n * @public\n */\nexport const participantListSelector: ParticipantListSelector = createSelector(\n [\n getIdentifier,\n getDisplayName,\n getRemoteParticipantsExcludingConsumers,\n getIsScreenSharingOn,\n getIsMuted,\n getLocalParticipantRaisedHand,\n getRole,\n getParticipantCount,\n isHideAttendeeNamesEnabled,\n getLocalParticipantReactionState,\n getSpotlightCallFeature,\n /* @conditional-compile-remove(media-access) */\n getCapabilities\n ],\n (\n userId,\n displayName,\n remoteParticipants,\n isScreenSharingOn,\n isMuted,\n raisedHand,\n role,\n partitipantCount,\n isHideAttendeeNamesEnabled,\n localParticipantReactionState,\n spotlightCallFeature,\n /* @conditional-compile-remove(media-access) */\n capabilities\n ): {\n participants: CallParticipantListParticipant[];\n myUserId: string;\n totalParticipantCount?: number;\n } => {\n const localUserCanRemoveOthers = localUserCanRemoveOthersTrampoline(role);\n const participants = remoteParticipants\n ? convertRemoteParticipantsToParticipantListParticipants(\n _updateUserDisplayNames(Object.values(remoteParticipants)),\n localUserCanRemoveOthers,\n isHideAttendeeNamesEnabled,\n role,\n spotlightCallFeature?.spotlightedParticipants\n )\n : [];\n participants.push({\n userId: userId,\n displayName: displayName,\n isScreenSharing: isScreenSharingOn,\n isMuted: isMuted,\n raisedHand: raisedHand,\n state: 'Connected',\n // Local participant can never remove themselves.\n isRemovable: false,\n reaction: memoizedConvertToVideoTileReaction(localParticipantReactionState),\n spotlight: memoizedSpotlight(spotlightCallFeature?.spotlightedParticipants, userId),\n /* @conditional-compile-remove(media-access) */\n mediaAccess: {\n isAudioPermitted: capabilities?.unmuteMic ? capabilities.unmuteMic.isPresent : true,\n isVideoPermitted: capabilities?.turnVideoOn ? capabilities.turnVideoOn.isPresent : true\n }\n });\n /* @conditional-compile-remove(total-participant-count) */\n const totalParticipantCount = partitipantCount;\n return {\n participants: participants,\n myUserId: userId,\n /* @conditional-compile-remove(total-participant-count) */\n totalParticipantCount: totalParticipantCount\n };\n }\n);\n\nconst localUserCanRemoveOthersTrampoline = (role?: string): boolean => {\n return role === 'Presenter' || role === 'Unknown' || role === undefined;\n};\n"]}
|
1
|
+
{"version":3,"file":"participantListSelector.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/participantListSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EACL,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,UAAU,EAEV,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,oCAAoC,EAAE,MAAM,sCAAsC,C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YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;YACnF,gBAAgB,EAAE,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,EAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;SACxF;KACF,CAAC,CAAC;IACH,0DAA0D;IAC1D,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;IAC/C,OAAO;QACL,YAAY,EAAE,YAAY;QAC1B,QAAQ,EAAE,MAAM;QAChB,0DAA0D;QAC1D,qBAAqB,EAAE,qBAAqB;KAC7C,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,kCAAkC,GAAG,CAAC,IAAa,EAAW,EAAE;IACpE,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,CAAC;AAC1E,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallClientState, RemoteParticipantState } from '@internal/calling-stateful-client';\nimport { createSelector } from 'reselect';\nimport {\n getIdentifier,\n getDisplayName,\n getIsScreenSharingOn,\n getIsMuted,\n CallingBaseSelectorProps,\n getCapabilities\n} from './baseSelectors';\nimport { getRole } from './baseSelectors';\nimport { isHideAttendeeNamesEnabled } from './baseSelectors';\nimport { CallParticipantListParticipant } from '@internal/react-components';\nimport { _convertParticipantState, _updateUserDisplayNames } from './utils/callUtils';\nimport { memoizedConvertAllremoteParticipants } from './utils/participantListSelectorUtils';\nimport { memoizedConvertToVideoTileReaction, memoizedSpotlight } from './utils/participantListSelectorUtils';\nimport { getLocalParticipantRaisedHand } from './baseSelectors';\nimport { getLocalParticipantReactionState } from './baseSelectors';\nimport { getSpotlightCallFeature } from './baseSelectors';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { getParticipantCount } from './baseSelectors';\nimport { isMicrosoftTeamsAppIdentifier, isPhoneNumberIdentifier } from '@azure/communication-common';\nimport { ParticipantRole, SpotlightedParticipant } from '@azure/communication-calling';\nimport { maskDisplayNameWithRole } from './utils/callUtils';\nimport { getRemoteParticipantsExcludingConsumers } from './getRemoteParticipantsExcludingConsumers';\n\nconst convertRemoteParticipantsToParticipantListParticipants = (\n remoteParticipants: RemoteParticipantState[],\n localUserCanRemoveOthers: boolean,\n isHideAttendeeNamesEnabled?: boolean,\n localUserRole?: ParticipantRole,\n spotlightedParticipants?: SpotlightedParticipant[]\n): CallParticipantListParticipant[] => {\n const conversionCallback = (\n memoizeFn: (...args: any[]) => CallParticipantListParticipant\n ): CallParticipantListParticipant[] => {\n return (\n remoteParticipants\n // Filter out MicrosoftBot participants\n .filter((participant: RemoteParticipantState) => {\n return !isMicrosoftTeamsAppIdentifier(participant.identifier);\n })\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) => {\n return (\n !['InLobby', 'Idle', 'Connecting', 'Disconnected'].includes(participant.state) ||\n isPhoneNumberIdentifier(participant.identifier)\n );\n })\n .map((participant: RemoteParticipantState) => {\n const isScreenSharing = Object.values(participant.videoStreams).some(\n (videoStream) => videoStream.mediaStreamType === 'ScreenSharing' && videoStream.isAvailable\n );\n /**\n * We want to check the participant to see if they are a PSTN participant joining the call\n * and mapping their state to be 'Ringing'\n */\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 = memoizedSpotlight(\n spotlightedParticipants,\n toFlatCommunicationIdentifier(participant.identifier)\n );\n\n return memoizeFn(\n toFlatCommunicationIdentifier(participant.identifier),\n displayName,\n state,\n participant.isMuted,\n isScreenSharing,\n participant.isSpeaking,\n participant.raisedHand,\n localUserCanRemoveOthers,\n remoteParticipantReaction,\n spotlight,\n participant.mediaAccess\n );\n })\n .sort((a, b) => {\n const nameA = a.displayName?.toLowerCase() || '';\n const nameB = b.displayName?.toLowerCase() || '';\n if (nameA < nameB) {\n return -1;\n } else if (nameA > nameB) {\n return 1;\n } else {\n return 0;\n }\n })\n );\n };\n return memoizedConvertAllremoteParticipants(conversionCallback);\n};\n\n/**\n * Selector type for {@link ParticipantList} component.\n *\n * @public\n */\nexport type ParticipantListSelector = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n) => {\n participants: CallParticipantListParticipant[];\n myUserId: string;\n /* @conditional-compile-remove(total-participant-count) */\n totalParticipantCount?: number;\n};\n\n/**\n * Selects data that drives {@link ParticipantList} component.\n *\n * @public\n */\nexport const participantListSelector: ParticipantListSelector = createSelector(\n [\n getIdentifier,\n getDisplayName,\n getRemoteParticipantsExcludingConsumers,\n getIsScreenSharingOn,\n getIsMuted,\n getLocalParticipantRaisedHand,\n getRole,\n getParticipantCount,\n isHideAttendeeNamesEnabled,\n getLocalParticipantReactionState,\n getSpotlightCallFeature,\n getCapabilities\n ],\n (\n userId,\n displayName,\n remoteParticipants,\n isScreenSharingOn,\n isMuted,\n raisedHand,\n role,\n partitipantCount,\n isHideAttendeeNamesEnabled,\n localParticipantReactionState,\n spotlightCallFeature,\n capabilities\n ): {\n participants: CallParticipantListParticipant[];\n myUserId: string;\n totalParticipantCount?: number;\n } => {\n const localUserCanRemoveOthers = localUserCanRemoveOthersTrampoline(role);\n const participants = remoteParticipants\n ? convertRemoteParticipantsToParticipantListParticipants(\n _updateUserDisplayNames(Object.values(remoteParticipants)),\n localUserCanRemoveOthers,\n isHideAttendeeNamesEnabled,\n role,\n spotlightCallFeature?.spotlightedParticipants\n )\n : [];\n participants.push({\n userId: userId,\n displayName: displayName,\n isScreenSharing: isScreenSharingOn,\n isMuted: isMuted,\n raisedHand: raisedHand,\n state: 'Connected',\n // Local participant can never remove themselves.\n isRemovable: false,\n reaction: memoizedConvertToVideoTileReaction(localParticipantReactionState),\n spotlight: memoizedSpotlight(spotlightCallFeature?.spotlightedParticipants, userId),\n mediaAccess: {\n isAudioPermitted: capabilities?.unmuteMic ? capabilities.unmuteMic.isPresent : true,\n isVideoPermitted: capabilities?.turnVideoOn ? capabilities.turnVideoOn.isPresent : true\n }\n });\n /* @conditional-compile-remove(total-participant-count) */\n const totalParticipantCount = partitipantCount;\n return {\n participants: participants,\n myUserId: userId,\n /* @conditional-compile-remove(total-participant-count) */\n totalParticipantCount: totalParticipantCount\n };\n }\n);\n\nconst localUserCanRemoveOthersTrampoline = (role?: string): boolean => {\n return role === 'Presenter' || role === 'Unknown' || role === undefined;\n};\n"]}
|
package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.d.ts
CHANGED
@@ -4,12 +4,11 @@ import { CallParticipantListParticipant } from "../../../react-components/src";
|
|
4
4
|
import { Spotlight } from "../../../react-components/src";
|
5
5
|
import { RaisedHandState } from "../../../calling-stateful-client/src";
|
6
6
|
import { ReactionState } from "../../../calling-stateful-client/src";
|
7
|
-
import { Reaction } from "../../../react-components/src";
|
8
|
-
import { MediaAccess } from "../../../react-components/src";
|
7
|
+
import { Reaction, MediaAccess } from "../../../react-components/src";
|
9
8
|
/**
|
10
9
|
* @private
|
11
10
|
*/
|
12
|
-
export declare const memoizedConvertAllremoteParticipants: (callback: import("../../../acs-ui-common/src").CallbackType<string, [displayName: string | undefined, state: RemoteParticipantState, isMuted: boolean, isScreenSharing: boolean, isSpeaking: boolean, raisedHand: RaisedHandState | undefined, localUserCanRemoveOthers: boolean, reaction: Reaction | undefined, spotlight: Spotlight | undefined, mediaAccess: MediaAccess
|
11
|
+
export declare const memoizedConvertAllremoteParticipants: (callback: import("../../../acs-ui-common/src").CallbackType<string, [displayName: string | undefined, state: RemoteParticipantState, isMuted: boolean, isScreenSharing: boolean, isSpeaking: boolean, raisedHand: RaisedHandState | undefined, localUserCanRemoveOthers: boolean, reaction: Reaction | undefined, spotlight: Spotlight | undefined, mediaAccess: MediaAccess], CallParticipantListParticipant>) => CallParticipantListParticipant[];
|
13
12
|
/**
|
14
13
|
* @private
|
15
14
|
*/
|
package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"participantListSelectorUtils.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/utils/participantListSelectorUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,YAAY,EAAE,mCAAgC;AACxF,OAAO,EAAE,6BAA6B,EAAE,mCAAgC;
|
1
|
+
{"version":3,"file":"participantListSelectorUtils.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/utils/participantListSelectorUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,YAAY,EAAE,mCAAgC;AACxF,OAAO,EAAE,6BAA6B,EAAE,mCAAgC;AAMxE,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,MAAM,oDAAoD,GAAG,CAC3D,MAAc,EACd,WAA+B,EAC/B,KAA6B,EAC7B,OAAgB,EAChB,eAAwB,EACxB,UAAmB,EACnB,UAAuC,EACvC,wBAAiC,EACjC,QAA8B,EAC9B,SAAgC,EAChC,WAAwB,EACQ,EAAE;IAClC,MAAM,UAAU,GAAG,+BAA+B,CAAC,MAAM,CAAC,CAAC;IAC3D,OAAO;QACL,MAAM;QACN,WAAW;QACX,KAAK;QACL,OAAO;QACP,eAAe;QACf,UAAU;QACV,UAAU;QACV,wCAAwC;QACxC,gDAAgD;QAChD,WAAW,EACT,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,IAAI,KAAK,mBAAmB;YACzD,iBAAiB,CAAC,UAAU,CAAC,CAAC,IAAI,KAAK,aAAa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Licensed under the MIT License.\n\nimport { RemoteParticipantState } from '@azure/communication-calling';\nimport { SpotlightedParticipant } from '@azure/communication-calling';\nimport { getIdentifierKind } from '@azure/communication-common';\nimport { fromFlatCommunicationIdentifier, memoizeFnAll } from '@internal/acs-ui-common';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { CallParticipantListParticipant } from '@internal/react-components';\nimport { Spotlight } from '@internal/react-components';\nimport { RaisedHandState } from '@internal/calling-stateful-client';\nimport { ReactionState } from '@internal/calling-stateful-client';\nimport { Reaction, MediaAccess } from '@internal/react-components';\nimport memoizeOne from 'memoize-one';\n\nconst convertRemoteParticipantToParticipantListParticipant = (\n userId: string,\n displayName: string | undefined,\n state: RemoteParticipantState,\n isMuted: boolean,\n isScreenSharing: boolean,\n isSpeaking: boolean,\n raisedHand: RaisedHandState | undefined,\n localUserCanRemoveOthers: boolean,\n reaction: undefined | Reaction,\n spotlight: undefined | Spotlight,\n mediaAccess: MediaAccess\n): CallParticipantListParticipant => {\n const identifier = fromFlatCommunicationIdentifier(userId);\n return {\n userId,\n displayName,\n state,\n isMuted,\n isScreenSharing,\n isSpeaking,\n raisedHand,\n // ACS users can not remove Teams users.\n // Removing unknown types of users is undefined.\n isRemovable:\n (getIdentifierKind(identifier).kind === 'communicationUser' ||\n getIdentifierKind(identifier).kind === 'phoneNumber') &&\n localUserCanRemoveOthers,\n reaction,\n spotlight,\n mediaAccess\n };\n};\n\n/**\n * @private\n */\nexport const memoizedConvertAllremoteParticipants = memoizeFnAll(\n (\n userId: string,\n displayName: string | undefined,\n state: RemoteParticipantState,\n isMuted: boolean,\n isScreenSharing: boolean,\n isSpeaking: boolean,\n raisedHand: RaisedHandState | undefined,\n localUserCanRemoveOthers: boolean,\n reaction: undefined | Reaction,\n spotlight: undefined | Spotlight,\n mediaAccess: MediaAccess\n ): CallParticipantListParticipant => {\n return convertRemoteParticipantToParticipantListParticipant(\n userId,\n displayName,\n state,\n isMuted,\n isScreenSharing,\n isSpeaking,\n raisedHand,\n localUserCanRemoveOthers,\n reaction,\n spotlight,\n mediaAccess\n );\n }\n);\n\n/**\n * @private\n */\nexport const memoizedConvertToVideoTileReaction = memoizeOne(\n (reactionState: ReactionState | undefined): Reaction | undefined => {\n return reactionState && reactionState.reactionMessage\n ? {\n reactionType: reactionState.reactionMessage.reactionType,\n receivedOn: reactionState.receivedOn\n }\n : undefined;\n }\n);\n\n/**\n * @private\n */\nexport const memoizedSpotlight = memoizeOne(\n (spotlightedParticipants: SpotlightedParticipant[] | undefined, userId: string): Spotlight | undefined => {\n const spotlightOrder = spotlightedParticipants?.find(\n (spotlightedParticipant) => toFlatCommunicationIdentifier(spotlightedParticipant.identifier) === userId\n );\n return spotlightOrder ? { spotlightedOrderPosition: spotlightOrder.order } : undefined;\n }\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?: undefined | /* @conditional-compile-remove(remote-ufd) */ number, mediaAccess?:
|
18
|
+
}, state: ParticipantConnectionState, displayName?: string, raisedHand?: RaisedHandState, contentSharingStream?: HTMLElement, reaction?: Reaction, spotlight?: Spotlight, signalStrength?: undefined | /* @conditional-compile-remove(remote-ufd) */ number, mediaAccess?: MediaAccess, role?: 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;
|
@@ -33,11 +33,7 @@ export const _videoGalleryRemoteParticipantsMemo = (remoteParticipants, isHideAt
|
|
33
33
|
const displayName = maskDisplayNameWithRole(participant.displayName, localUserRole, participant.role, isHideAttendeeNamesEnabled);
|
34
34
|
const remoteParticipantReaction = memoizedConvertToVideoTileReaction(participant.reactionState);
|
35
35
|
const spotlight = participant.spotlight;
|
36
|
-
return memoizedFn(toFlatCommunicationIdentifier(participant.identifier), participant.isMuted, checkIsSpeaking(participant), participant.videoStreams, state, displayName, participant.raisedHand, participant.contentSharingStream, remoteParticipantReaction, spotlight,
|
37
|
-
/* @conditional-compile-remove(media-access) */
|
38
|
-
participant.mediaAccess,
|
39
|
-
/* @conditional-compile-remove(media-access) */
|
40
|
-
participant.role,
|
36
|
+
return memoizedFn(toFlatCommunicationIdentifier(participant.identifier), participant.isMuted, checkIsSpeaking(participant), participant.videoStreams, state, displayName, participant.raisedHand, participant.contentSharingStream, remoteParticipantReaction, spotlight, participant.mediaAccess, participant.role,
|
41
37
|
/* @conditional-compile-remove(remote-ufd) */
|
42
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)));
|
43
39
|
}));
|
@@ -83,11 +79,8 @@ export const convertRemoteParticipantToVideoGalleryRemoteParticipant = (userId,
|
|
83
79
|
raisedHand,
|
84
80
|
reaction,
|
85
81
|
spotlight,
|
86
|
-
/* @conditional-compile-remove(media-access) */
|
87
82
|
mediaAccess,
|
88
|
-
/* @conditional-compile-remove(media-access) */
|
89
83
|
canAudioBeForbidden: role === 'Attendee',
|
90
|
-
/* @conditional-compile-remove(media-access) */
|
91
84
|
canVideoBeForbidden: role === 'Attendee',
|
92
85
|
/* @conditional-compile-remove(remote-ufd) */
|
93
86
|
signalStrength
|
@@ -135,7 +128,6 @@ export const memoizeLocalParticipant = memoizeOne((identifier, displayName, isMu
|
|
135
128
|
reaction,
|
136
129
|
spotlight: localSpotlight,
|
137
130
|
capabilities,
|
138
|
-
/* @conditional-compile-remove(media-access) */
|
139
131
|
mediaAccess: {
|
140
132
|
isAudioPermitted: (capabilities === null || capabilities === void 0 ? void 0 : capabilities.unmuteMic) ? capabilities.unmuteMic.isPresent : true,
|
141
133
|
isVideoPermitted: (capabilities === null || capabilities === void 0 ? void 0 : capabilities.turnVideoOn) ? capabilities.turnVideoOn.isPresent : true
|
@@ -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,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,EAAE;IACnC,IAAI,CAAC,kBAAk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AAU;SAC7D;KACF,CAAC,CAAA;CAAA,CAAC,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(media-access) */\n participant.mediaAccess,\n /* @conditional-compile-remove(media-access) */\n participant.role,\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 );\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 mediaAccess?: undefined | /* @conditional-compile-remove(media-access) */ MediaAccess,\n role?: undefined | /* @conditional-compile-remove(media-access) */ ParticipantRole,\n signalStrength?: undefined | /* @conditional-compile-remove(remote-ufd) */ number\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 signalStrength,\n mediaAccess,\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 signalStrength?: undefined | /* @conditional-compile-remove(remote-ufd) */ 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(media-access) */\n mediaAccess,\n /* @conditional-compile-remove(media-access) */\n canAudioBeForbidden: role === 'Attendee',\n /* @conditional-compile-remove(media-access) */\n canVideoBeForbidden: role === 'Attendee',\n /* @conditional-compile-remove(remote-ufd) */\n signalStrength\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 ? capabilities.unmuteMic.isPresent : true,\n isVideoPermitted: capabilities?.turnVideoOn ? capabilities.turnVideoOn.isPresent : true\n }\n })\n);\n\n/** @private */\nexport const memoizeSpotlightedParticipantIds = memoizeOne((spotlightedParticipants) =>\n spotlightedParticipants?.map((p: SpotlightedParticipant) => toFlatCommunicationIdentifier(p.identifier))\n);\n\n/** @private */\nexport const memoizeTogetherModeStreams = memoizeOne((togetherModeStreams) => ({\n mainVideoStream: {\n id: togetherModeStreams?.mainVideoStream?.id,\n isReceiving: togetherModeStreams?.mainVideoStream?.isReceiving,\n isAvailable: togetherModeStreams?.mainVideoStream?.isAvailable,\n renderElement: togetherModeStreams?.mainVideoStream?.view?.target,\n streamSize: togetherModeStreams?.mainVideoStream?.streamSize\n }\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;AAGtF,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,EAAE;IACnC,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,mCAAmC,CAAC,CAA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S,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;YACnF,gBAAgB,EAAE,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,EAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;SACxF;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;AAEF,eAAe;AACf,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC,CAAC,mBAAmB,EAAE,EAAE;;IAAC,OAAA,CAAC;QAC7E,eAAe,EAAE;YACf,EAAE,EAAE,MAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,eAAe,0CAAE,EAAE;YAC5C,WAAW,EAAE,MAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,eAAe,0CAAE,WAAW;YAC9D,WAAW,EAAE,MAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,eAAe,0CAAE,WAAW;YAC9D,aAAa,EAAE,MAAA,MAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,eAAe,0CAAE,IAAI,0CAAE,MAAM;YACjE,UAAU,EAAE,MAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,eAAe,0CAAE,UAAU;SAC7D;KACF,CAAC,CAAA;CAAA,CAAC,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 { VideoGalleryRemoteParticipant, VideoGalleryStream, MediaAccess } 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 participant.mediaAccess,\n participant.role,\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 );\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 mediaAccess?: MediaAccess,\n role?: ParticipantRole,\n signalStrength?: undefined | /* @conditional-compile-remove(remote-ufd) */ number\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 signalStrength,\n mediaAccess,\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 signalStrength?: undefined | /* @conditional-compile-remove(remote-ufd) */ number,\n mediaAccess?: MediaAccess,\n role?: 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 mediaAccess,\n canAudioBeForbidden: role === 'Attendee',\n canVideoBeForbidden: role === 'Attendee',\n /* @conditional-compile-remove(remote-ufd) */\n signalStrength\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 mediaAccess: {\n isAudioPermitted: capabilities?.unmuteMic ? capabilities.unmuteMic.isPresent : true,\n isVideoPermitted: capabilities?.turnVideoOn ? capabilities.turnVideoOn.isPresent : true\n }\n })\n);\n\n/** @private */\nexport const memoizeSpotlightedParticipantIds = memoizeOne((spotlightedParticipants) =>\n spotlightedParticipants?.map((p: SpotlightedParticipant) => toFlatCommunicationIdentifier(p.identifier))\n);\n\n/** @private */\nexport const memoizeTogetherModeStreams = memoizeOne((togetherModeStreams) => ({\n mainVideoStream: {\n id: togetherModeStreams?.mainVideoStream?.id,\n isReceiving: togetherModeStreams?.mainVideoStream?.isReceiving,\n isAvailable: togetherModeStreams?.mainVideoStream?.isAvailable,\n renderElement: togetherModeStreams?.mainVideoStream?.view?.target,\n streamSize: togetherModeStreams?.mainVideoStream?.streamSize\n }\n}));\n"]}
|
@@ -55,13 +55,7 @@ togetherModeCallFeature) => {
|
|
55
55
|
const spotlightedParticipantIds = memoizeSpotlightedParticipantIds(spotlightCallFeature === null || spotlightCallFeature === void 0 ? void 0 : spotlightCallFeature.spotlightedParticipants);
|
56
56
|
return {
|
57
57
|
screenShareParticipant: screenShareRemoteParticipant
|
58
|
-
? convertRemoteParticipantToVideoGalleryRemoteParticipant(toFlatCommunicationIdentifier(screenShareRemoteParticipant.identifier), screenShareRemoteParticipant.isMuted, checkIsSpeaking(screenShareRemoteParticipant), screenShareRemoteParticipant.videoStreams, screenShareRemoteParticipant.state, screenShareRemoteParticipant.displayName, screenShareRemoteParticipant.raisedHand, screenShareRemoteParticipant.contentSharingStream, undefined, screenShareRemoteParticipant.spotlight,
|
59
|
-
/* @conditional-compile-remove(media-access) */
|
60
|
-
undefined,
|
61
|
-
/* @conditional-compile-remove(media-access) */
|
62
|
-
screenShareRemoteParticipant.mediaAccess,
|
63
|
-
/* @conditional-compile-remove(media-access) */
|
64
|
-
role)
|
58
|
+
? convertRemoteParticipantToVideoGalleryRemoteParticipant(toFlatCommunicationIdentifier(screenShareRemoteParticipant.identifier), screenShareRemoteParticipant.isMuted, checkIsSpeaking(screenShareRemoteParticipant), screenShareRemoteParticipant.videoStreams, screenShareRemoteParticipant.state, screenShareRemoteParticipant.displayName, screenShareRemoteParticipant.raisedHand, screenShareRemoteParticipant.contentSharingStream, undefined, screenShareRemoteParticipant.spotlight, undefined, screenShareRemoteParticipant.mediaAccess, role)
|
65
59
|
: undefined,
|
66
60
|
localParticipant: memoizeLocalParticipant(identifier, displayName, isMuted, isScreenSharingOn, localVideoStream, localScreenSharingStream, role, raisedHand, localParticipantReactionState, spotlightCallFeature === null || spotlightCallFeature === void 0 ? void 0 : spotlightCallFeature.localParticipantSpotlight, capabilities),
|
67
61
|
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;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;QAChD,oBAAoB,EAAE,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,QAAQ;QACvD,gDAAgD;QAChD,wBAAwB,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,iBAAiB,CAAC,SAAS;KACpE,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';\n/* @conditional-compile-remove(together-mode) */\nimport {\n VideoGalleryTogetherModeStreams,\n VideoGalleryTogetherModeParticipantPosition\n} 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';\n/* @conditional-compile-remove(together-mode) */\nimport { getTogetherModeCallFeature } 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 /* @conditional-compile-remove(together-mode) */ memoizeTogetherModeStreams\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 /* @conditional-compile-remove(together-mode) */\n isTogetherModeActive?: boolean;\n /* @conditional-compile-remove(together-mode) */\n startTogetherModeEnabled?: boolean;\n /* @conditional-compile-remove(together-mode) */\n togetherModeStreams?: VideoGalleryTogetherModeStreams;\n /* @conditional-compile-remove(together-mode) */\n togetherModeSeatingCoordinates?: VideoGalleryTogetherModeParticipantPosition;\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 /* @conditional-compile-remove(together-mode) */\n getTogetherModeCallFeature\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 /* @conditional-compile-remove(together-mode) */\n togetherModeCallFeature\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 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 /* @conditional-compile-remove(together-mode) */\n togetherModeStreams: memoizeTogetherModeStreams(togetherModeCallFeature?.streams),\n /* @conditional-compile-remove(together-mode) */\n togetherModeSeatingCoordinates: togetherModeCallFeature?.seatingPositions,\n /* @conditional-compile-remove(together-mode) */\n isTogetherModeActive: togetherModeCallFeature?.isActive,\n /* @conditional-compile-remove(together-mode) */\n startTogetherModeEnabled: capabilities?.startTogetherMode.isPresent\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;AAQxE,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,gDAAgD;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,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;AACvB,gDAAgD,CAAC,0BAA0B,EAC5E,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,kCAAkC,EA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QACpC,qBAAqB,EAAE,iBAAiB;QACxC,uBAAuB,EAAE,yBAAyB;QAClD,0BAA0B,EAAE,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,0BAA0B;QAC5E,gDAAgD;QAChD,mBAAmB,EAAE,0BAA0B,CAAC,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,OAAO,CAAC;QACjF,gDAAgD;QAChD,8BAA8B,EAAE,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,gBAAgB;QACzE,gDAAgD;QAChD,oBAAoB,EAAE,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,QAAQ;QACvD,gDAAgD;QAChD,wBAAwB,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,iBAAiB,CAAC,SAAS;KACpE,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';\n/* @conditional-compile-remove(together-mode) */\nimport {\n VideoGalleryTogetherModeStreams,\n VideoGalleryTogetherModeParticipantPosition\n} 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';\n/* @conditional-compile-remove(together-mode) */\nimport { getTogetherModeCallFeature } 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 /* @conditional-compile-remove(together-mode) */ memoizeTogetherModeStreams\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 /* @conditional-compile-remove(together-mode) */\n isTogetherModeActive?: boolean;\n /* @conditional-compile-remove(together-mode) */\n startTogetherModeEnabled?: boolean;\n /* @conditional-compile-remove(together-mode) */\n togetherModeStreams?: VideoGalleryTogetherModeStreams;\n /* @conditional-compile-remove(together-mode) */\n togetherModeSeatingCoordinates?: VideoGalleryTogetherModeParticipantPosition;\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 /* @conditional-compile-remove(together-mode) */\n getTogetherModeCallFeature\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 /* @conditional-compile-remove(together-mode) */\n togetherModeCallFeature\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 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 undefined,\n screenShareRemoteParticipant.mediaAccess,\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 /* @conditional-compile-remove(together-mode) */\n togetherModeStreams: memoizeTogetherModeStreams(togetherModeCallFeature?.streams),\n /* @conditional-compile-remove(together-mode) */\n togetherModeSeatingCoordinates: togetherModeCallFeature?.seatingPositions,\n /* @conditional-compile-remove(together-mode) */\n isTogetherModeActive: togetherModeCallFeature?.isActive,\n /* @conditional-compile-remove(together-mode) */\n startTogetherModeEnabled: capabilities?.startTogetherMode.isPresent\n };\n }\n);\n"]}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { AudioDeviceInfo, CallDirection, CallEndReason, CallerInfo, CallState as CallStatus, DeviceAccess, DominantSpeakersInfo, IncomingCallKind, LatestMediaDiagnostics, LatestNetworkDiagnostics, MediaStreamType, ParticipantRole, RemoteParticipantState as RemoteParticipantStatus, ScalingMode, VideoDeviceInfo } from '@azure/communication-calling';
|
2
2
|
import { BreakoutRoom, BreakoutRoomsSettings } from '@azure/communication-calling';
|
3
3
|
import type { ServerDiagnosticType, MediaDiagnosticType, NetworkDiagnosticType, DiagnosticValueType, DiagnosticQuality, DiagnosticFlag } from '@azure/communication-calling';
|
4
|
+
import { ParticipantInfo, RealTimeTextResultType } from '@azure/communication-calling';
|
4
5
|
import { TeamsCallInfo } from '@azure/communication-calling';
|
5
6
|
import { CallInfo } from '@azure/communication-calling';
|
6
7
|
import { CapabilitiesChangeInfo, ParticipantCapabilities } from '@azure/communication-calling';
|
@@ -51,6 +52,10 @@ export interface CaptionsInfo {
|
|
51
52
|
* Timestamp of when the captioned words were initially spoken.
|
52
53
|
*/
|
53
54
|
timestamp: Date;
|
55
|
+
/**
|
56
|
+
* Timestamp of when the captions were last updated.
|
57
|
+
*/
|
58
|
+
lastUpdatedTimestamp?: Date;
|
54
59
|
/**
|
55
60
|
* The language that the captions are presented in. Corresponds to the captionLanguage specified in startCaptions / setCaptionLanguage.
|
56
61
|
*/
|
@@ -60,6 +65,40 @@ export interface CaptionsInfo {
|
|
60
65
|
*/
|
61
66
|
spokenText?: string;
|
62
67
|
}
|
68
|
+
/**
|
69
|
+
* @beta
|
70
|
+
*/
|
71
|
+
export interface RealTimeTextInfo {
|
72
|
+
/**
|
73
|
+
* The sequence id of the real time text.
|
74
|
+
*/
|
75
|
+
sequenceId: number;
|
76
|
+
/**
|
77
|
+
* The sender of the real time text.
|
78
|
+
*/
|
79
|
+
sender: ParticipantInfo;
|
80
|
+
/**
|
81
|
+
* The real time text message.
|
82
|
+
*/
|
83
|
+
message: string;
|
84
|
+
/**
|
85
|
+
* The result type of the real time text message.
|
86
|
+
*/
|
87
|
+
resultType: RealTimeTextResultType;
|
88
|
+
/**
|
89
|
+
* The timestamp when the real time text message was created.
|
90
|
+
*/
|
91
|
+
receivedTimestamp?: Date;
|
92
|
+
/**
|
93
|
+
* The timestamp when the real time text message was last updated.
|
94
|
+
*/
|
95
|
+
updatedTimestamp?: Date;
|
96
|
+
/**
|
97
|
+
* If message originated from the local participant
|
98
|
+
* default is false
|
99
|
+
*/
|
100
|
+
isMe?: boolean;
|
101
|
+
}
|
63
102
|
/**
|
64
103
|
* @public
|
65
104
|
*/
|
@@ -97,6 +136,23 @@ export interface CaptionsCallFeatureState {
|
|
97
136
|
*/
|
98
137
|
captionsKind: CaptionsKind;
|
99
138
|
}
|
139
|
+
/**
|
140
|
+
* @beta
|
141
|
+
*/
|
142
|
+
export interface RealTimeTextCallFeatureState {
|
143
|
+
/**
|
144
|
+
* array of received captions
|
145
|
+
*/
|
146
|
+
realTimeTexts: {
|
147
|
+
completedMessages?: RealTimeTextInfo[];
|
148
|
+
currentInProgress?: RealTimeTextInfo[];
|
149
|
+
myInProgress?: RealTimeTextInfo;
|
150
|
+
};
|
151
|
+
/**
|
152
|
+
* whether real time text is on/off
|
153
|
+
*/
|
154
|
+
isRealTimeTextFeatureActive?: boolean;
|
155
|
+
}
|
100
156
|
/**
|
101
157
|
* State only version of {@link @azure/communication-calling#TranscriptionCallFeature}. {@link StatefulCallClient} will
|
102
158
|
* automatically listen for transcription state of the call and update the state exposed by {@link StatefulCallClient}
|
@@ -574,9 +630,13 @@ export interface CallState {
|
|
574
630
|
*/
|
575
631
|
transcription: TranscriptionCallFeatureState;
|
576
632
|
/**
|
577
|
-
* Proxy of {@link @azure/communication-calling#
|
633
|
+
* Proxy of {@link @azure/communication-calling#CaptionsCallFeature}.
|
578
634
|
*/
|
579
635
|
captionsFeature: CaptionsCallFeatureState;
|
636
|
+
/**
|
637
|
+
* Proxy of {@link @azure/communication-calling#RealTimeTextCallFeature}.
|
638
|
+
*/
|
639
|
+
realTimeTextFeature: RealTimeTextCallFeatureState;
|
580
640
|
/**
|
581
641
|
* Proxy of {@link @azure/communication-calling#OptimalVideoCountCallFeature}.
|
582
642
|
*/
|