@azure/communication-react 1.24.0-alpha-202501310016 → 1.24.0-alpha-202502040016
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 +25 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CAFpQ8Yk.js → ChatMessageComponentAsRichTextEditBox-AkTSmAsd.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CAFpQ8Yk.js.map → ChatMessageComponentAsRichTextEditBox-AkTSmAsd.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DTWPl1yi.js → RichTextSendBoxWrapper-B3Xe7mdR.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DTWPl1yi.js.map → RichTextSendBoxWrapper-B3Xe7mdR.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-B8uYcMR8.js → index-CNpitKVB.js} +279 -524
- package/dist/dist-cjs/communication-react/index-CNpitKVB.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/communication-react/src/index.d.ts +1 -2
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/LocalVideoTile.js +2 -7
- package/dist/dist-esm/react-components/src/components/LocalVideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/NotificationStack.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantList.js +11 -23
- package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +6 -18
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/TogetherModeOverlay.js +24 -40
- package/dist/dist-esm/react-components/src/components/TogetherModeOverlay.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/LocalScreenShare.js +1 -3
- package/dist/dist-esm/react-components/src/components/VideoGallery/LocalScreenShare.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.d.ts +3 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.js +4 -72
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeStream.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeStream.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js +4 -17
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +1 -20
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +26 -3
- package/dist/dist-esm/react-components/src/components/VideoGallery.js +11 -36
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +1 -2
- package/dist/dist-esm/react-components/src/components/VideoTile.js +6 -39
- package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/TogetherMode.styles.d.ts +10 -1
- package/dist/dist-esm/react-components/src/components/styles/TogetherMode.styles.js +34 -5
- package/dist/dist-esm/react-components/src/components/styles/TogetherMode.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils.js +1 -13
- package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
- package/dist/dist-esm/react-components/src/index.d.ts +1 -1
- package/dist/dist-esm/react-components/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/ar-SA/strings.json +45 -22
- package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/strings.json +45 -22
- package/dist/dist-esm/react-components/src/localization/locales/cy-GB/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +43 -20
- package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/es-MX/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/fi-FI/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/fr-CA/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +45 -22
- package/dist/dist-esm/react-components/src/localization/locales/he-IL/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/nb-NO/strings.json +45 -22
- package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/pl-PL/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/sv-SE/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +44 -21
- package/dist/dist-esm/react-components/src/theming/icons.js +0 -6
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/ParticipantListParticipant.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js.map +1 -1
- 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 +2 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +0 -21
- 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.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +24 -38
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js +5 -23
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.d.ts +1 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +1 -85
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +0 -8
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +16 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +16 -1
- 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 +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +0 -8
- 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.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +0 -8
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +39 -5
- 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.js +38 -8
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/cy-GB/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/es-MX/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-CA/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +19 -0
- package/package.json +4 -4
- package/dist/dist-cjs/communication-react/index-B8uYcMR8.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ParticipantList.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ParticipantList.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,IAAI,EAGJ,KAAK,EACL,WAAW,EACX,eAAe,EACf,KAAK,EAEN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAgB,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,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AE,MAAM,EAAE,QAAQ,EAAE,IAC/C,aAAa,CAAC,8BAA8B,EAAE;YAC7C,aAAa,EAAE,GAAG,qBAAqB,GAAG,qBAAqB,CAAC,MAAM,EAAE;SACzE,CAAC,CACG,CACR,CAEC,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n Icon,\n IContextualMenuItem,\n IContextualMenuItemStyles,\n merge,\n mergeStyles,\n PersonaPresence,\n Stack,\n Theme\n} from '@fluentui/react';\nimport { Text } from '@fluentui/react';\nimport { useTheme, CallingTheme } from '../theming';\nimport { RaisedHandIcon } from './assets/RaisedHandIcon';\nimport React, { useCallback, useMemo } from 'react';\nimport { useIdentifiers } from '../identifiers';\nimport { useLocale } from '../localization';\nimport {\n BaseCustomStyles,\n CallParticipantListParticipant,\n OnRenderAvatarCallback,\n ParticipantListParticipant\n} from '../types';\nimport { CustomAvatarOptions } from '../types';\nimport {\n formatParticipantStateString,\n ParticipantItem,\n ParticipantItemStrings,\n ParticipantItemStyles\n} from './ParticipantItem';\nimport { iconStyles, participantListItemStyle, participantListStyle } from './styles/ParticipantList.styles';\nimport { _formatString } from '@internal/acs-ui-common';\n\n/**\n * Styles for the {@link ParticipantList} {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantListItemStyles extends ParticipantItemStyles {\n /** Styles applied to the sub-menu of the {@link ParticipantList} {@link ParticipantItem}. */\n participantSubMenuItemsStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Styles for the {@link ParticipantList}.\n *\n * @public\n */\nexport interface ParticipantListStyles extends BaseCustomStyles {\n /** Styles for the {@link ParticipantList} {@link ParticipantItem}. */\n participantItemStyles?: ParticipantListItemStyles;\n}\n\n/* @conditional-compile-remove(total-participant-count) */\n/**\n * Strings for the {@link ParticipantList}.\n *\n * @beta\n */\nexport interface ParticipantListStrings {\n /**\n * String for rendering the count of participants not contained in the displayed participant list\n */\n overflowParticipantCount?: string;\n}\n\n/**\n * A callback for providing custom menu items for each participant in {@link ParticipantList}.\n *\n * @public\n */\nexport type ParticipantMenuItemsCallback = (\n participantUserId: string,\n userId?: string,\n defaultMenuItems?: IContextualMenuItem[]\n) => IContextualMenuItem[];\n\n/**\n * Props for {@link ParticipantList}.\n *\n * @public\n */\nexport type ParticipantListProps = {\n /** Participants in user call or chat */\n participants: ParticipantListParticipant[];\n /** User ID of user */\n myUserId?: string;\n /**\n * If set to `true`, excludes the local participant from the participant list with use of `myUserId` props (required in this case).\n *\n * @defaultValue `false`\n */\n excludeMe?: boolean;\n /** Optional callback to render each participant. If no callback is provided, each participant will be rendered with `ParticipantItem` */\n onRenderParticipant?: (participant: ParticipantListParticipant) => JSX.Element | null;\n /** Optional callback to render the avatar for each participant. This property will have no effect if `onRenderParticipant` is assigned. */\n onRenderAvatar?: OnRenderAvatarCallback;\n /** Optional callback to render the context menu for each participant */\n onRemoveParticipant?: (userId: string) => void;\n /** Optional callback to render custom menu items for each participant. */\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /** Optional callback when rendered ParticipantItem is clicked */\n onParticipantClick?: (participant?: ParticipantListParticipant) => void;\n /** Optional callback to render a context menu to mute a participant */\n onMuteParticipant?: (userId: string) => Promise<void>;\n styles?: ParticipantListStyles;\n /** Optional value to determine if the tooltip should be shown for participants or not */\n showParticipantOverflowTooltip?: boolean;\n /* @conditional-compile-remove(total-participant-count) */\n /** Total number of people in the call. This number can be larger than the remote participant count. */\n totalParticipantCount?: number;\n /* @conditional-compile-remove(total-participant-count) */\n /** Strings for the participant list */\n strings?: ParticipantListStrings;\n /** Optional aria-labelledby prop that prefixes each ParticipantItem aria-label */\n participantAriaLabelledBy?: string;\n /** List of pinned participants */\n pinnedParticipants?: string[];\n};\n\nconst onRenderParticipantDefault = (\n participant: ParticipantListParticipant,\n strings: ParticipantItemStrings,\n myUserId?: string,\n onRenderAvatar?: OnRenderAvatarCallback,\n createParticipantMenuItems?: (participant: ParticipantListParticipant) => IContextualMenuItem[],\n styles?: ParticipantListItemStyles,\n onParticipantClick?: (participant?: ParticipantListParticipant) => void,\n showParticipantOverflowTooltip?: boolean,\n participantAriaLabelledBy?: string,\n theme?: Theme,\n pinnedParticipants?: string[]\n): JSX.Element | null => {\n const callingParticipant = participant as CallParticipantListParticipant;\n\n let presence: PersonaPresence | undefined = undefined;\n if (callingParticipant) {\n presence = PersonaPresence.none;\n }\n\n const menuItems = createParticipantMenuItems && createParticipantMenuItems(participant);\n\n const formatDisplayName = (displayName?: string): string | undefined => {\n if (displayName && strings.attendeeRole) {\n return _formatString(displayName, { AttendeeRole: strings.attendeeRole });\n }\n return displayName;\n };\n const displayName = formatDisplayName(participant.displayName);\n\n const callingPalette = (theme as unknown as CallingTheme).callingPalette;\n\n const isPinned = pinnedParticipants && pinnedParticipants?.includes(participant.userId);\n\n const showRenderIconTrampoline = (): boolean => {\n /* @conditional-compile-remove(media-access) */\n return !!(\n callingParticipant?.isScreenSharing ||\n callingParticipant?.isMuted ||\n callingParticipant?.raisedHand ||\n isPinned ||\n !(callingParticipant?.mediaAccess ? callingParticipant.mediaAccess.isAudioPermitted : true) ||\n !(callingParticipant?.mediaAccess ? callingParticipant.mediaAccess.isVideoPermitted : true)\n );\n\n return !!(\n callingParticipant?.isScreenSharing ||\n callingParticipant?.isMuted ||\n callingParticipant?.raisedHand ||\n isPinned\n );\n };\n\n const onRenderIcon = showRenderIconTrampoline()\n ? () => (\n <Stack horizontal={true} tokens={{ childrenGap: '0.5rem' }}>\n {callingParticipant.raisedHand && (\n <Stack\n horizontal={true}\n tokens={{ childrenGap: '0.2rem' }}\n style={{\n alignItems: 'center',\n padding: '0.1rem 0.2rem',\n backgroundColor: theme?.palette.neutralLighter,\n borderRadius: '0.3rem'\n }}\n >\n {callingParticipant.raisedHand.raisedHandOrderPosition && (\n <Stack.Item>\n <Text>{callingParticipant.raisedHand?.raisedHandOrderPosition}</Text>\n </Stack.Item>\n )}\n <Stack.Item>\n <RaisedHandIcon />\n </Stack.Item>\n </Stack>\n )}\n {callingParticipant.isScreenSharing && (\n <Icon\n iconName=\"ParticipantItemScreenShareStart\"\n className={iconStyles}\n ariaLabel={strings.sharingIconLabel}\n />\n )}\n {callingParticipant.spotlight && <Icon iconName=\"ParticipantItemSpotlighted\" className={iconStyles} />}\n {isPinned && <Icon iconName=\"ParticipantItemPinned\" className={iconStyles} />}\n {\n /* @conditional-compile-remove(media-access) */ callingParticipant.mediaAccess &&\n !callingParticipant.mediaAccess.isVideoPermitted ? (\n <Icon\n iconName=\"ControlButtonCameraProhibited\"\n className={iconStyles}\n ariaLabel={strings.mutedIconLabel}\n />\n ) : undefined\n }\n {\n /* @conditional-compile-remove(media-access) */ callingParticipant.mediaAccess &&\n !callingParticipant.mediaAccess?.isAudioPermitted ? (\n <Icon iconName=\"ControlButtonMicProhibited\" className={iconStyles} ariaLabel={strings.mutedIconLabel} />\n ) : undefined\n }\n {\n /* @conditional-compile-remove(media-access) */ (callingParticipant.mediaAccess\n ? callingParticipant.mediaAccess.isAudioPermitted\n : true) && callingParticipant.isMuted ? (\n <Icon iconName=\"ParticipantItemMicOff\" className={iconStyles} ariaLabel={strings.mutedIconLabel} />\n ) : undefined\n }\n </Stack>\n )\n : () => null;\n\n const onRenderAvatarWithRaiseHand =\n callingParticipant?.raisedHand && onRenderAvatar\n ? (\n userId?: string,\n options?: CustomAvatarOptions,\n defaultOnRender?: (props: CustomAvatarOptions) => JSX.Element\n ) =>\n onRenderAvatar(\n userId,\n { ...options, styles: { root: { border: callingPalette.raiseHandGold } } },\n defaultOnRender\n )\n : onRenderAvatar;\n\n const ariaLabelTemplate =\n (menuItems && menuItems.length > 0 ? strings?.participantItemWithMoreOptionsAriaLabel : undefined) ??\n strings?.participantItemAriaLabel;\n const ariaLabel = _formatString(ariaLabelTemplate ?? '', {\n displayName: displayName ?? '',\n connectionState: formatParticipantStateString(callingParticipant, strings) ?? '',\n mutedState: (callingParticipant.isMuted ? strings?.mutedIconLabel : undefined) ?? '',\n /* @conditional-compile-remove(media-access) */\n micDisabledState:\n (callingParticipant.mediaAccess?.isAudioPermitted === false ? strings?.micDisabledIconLabel : undefined) ?? '',\n /* @conditional-compile-remove(media-access) */\n cameraDisabledState:\n (callingParticipant.mediaAccess?.isVideoPermitted === false ? strings?.cameraDisabledIconLabel : undefined) ?? '',\n sharingState: (callingParticipant.isScreenSharing ? strings?.sharingIconLabel : undefined) ?? '',\n handRaisedState:\n (callingParticipant.raisedHand?.raisedHandOrderPosition\n ? _formatString(strings?.handRaisedIconLabel ?? '', {\n position: callingParticipant.raisedHand?.raisedHandOrderPosition?.toString() ?? ''\n })\n : undefined) ?? ''\n });\n\n return (\n <ParticipantItem\n styles={styles}\n key={participant.userId}\n userId={participant.userId}\n displayName={displayName}\n me={myUserId ? participant.userId === myUserId : false}\n menuItems={menuItems}\n presence={presence}\n onRenderIcon={onRenderIcon}\n onRenderAvatar={onRenderAvatarWithRaiseHand}\n onClick={onParticipantClick ? () => onParticipantClick?.(participant) : undefined}\n showParticipantOverflowTooltip={showParticipantOverflowTooltip}\n participantState={callingParticipant.state}\n ariaLabelledBy={participantAriaLabelledBy}\n strings={{\n participantItemAriaLabel: ariaLabel\n }}\n />\n );\n};\n\n/**\n * Sort participants by raised hand order position\n */\nconst sortParticipants = (participants: ParticipantListParticipant[]): ParticipantListParticipant[] => {\n const isParticipantListCallParticipant = function (participant: ParticipantListParticipant): boolean {\n return 'raisedHand' in participant;\n };\n\n participants.sort((a, b) => {\n if (!isParticipantListCallParticipant(a) || !isParticipantListCallParticipant(b)) {\n return 0;\n }\n const callA = a as CallParticipantListParticipant;\n const callB = b as CallParticipantListParticipant;\n if (callA.raisedHand && callB.raisedHand) {\n return callA.raisedHand.raisedHandOrderPosition - callB.raisedHand.raisedHandOrderPosition;\n } else if (callA.raisedHand) {\n return -1;\n } else if (callB.raisedHand) {\n return 1;\n }\n return 0;\n });\n return participants;\n};\n\nconst getParticipantsForDefaultRender = (\n participants: ParticipantListParticipant[],\n excludeMe: boolean,\n myUserId: string | undefined\n): ParticipantListParticipant[] => {\n if (!excludeMe || !myUserId) {\n return [...participants];\n }\n\n const userIndex = participants.map((p) => p.userId).indexOf(myUserId);\n\n if (userIndex === -1) {\n return [...participants];\n }\n\n const remoteParticipants = [...participants];\n remoteParticipants.splice(userIndex, 1);\n\n return remoteParticipants;\n};\n\n/**\n * Component to render all calling or chat participants.\n *\n * By default, each participant is rendered with {@link ParticipantItem}. See {@link ParticipantListProps.onRenderParticipant} to override.\n *\n * @public\n */\nexport const ParticipantList = (props: ParticipantListProps): JSX.Element => {\n const {\n excludeMe = false,\n myUserId,\n participants,\n onRemoveParticipant,\n onRenderAvatar,\n onRenderParticipant,\n onFetchParticipantMenuItems,\n showParticipantOverflowTooltip,\n /* @conditional-compile-remove(total-participant-count) */\n totalParticipantCount,\n /* @conditional-compile-remove(total-participant-count) */\n strings,\n participantAriaLabelledBy,\n pinnedParticipants\n } = props;\n\n const theme = useTheme();\n const ids = useIdentifiers();\n const participantItemStrings = useLocale().strings.participantItem;\n /* @conditional-compile-remove(total-participant-count) */\n const participantListStrings = useLocale().strings.ParticipantList;\n\n const displayedParticipants: ParticipantListParticipant[] = useMemo(() => {\n return onRenderParticipant ? participants : getParticipantsForDefaultRender(participants, excludeMe, myUserId);\n }, [participants, excludeMe, myUserId, onRenderParticipant]);\n\n sortParticipants(displayedParticipants);\n\n const createParticipantMenuItems = useCallback(\n (participant: ParticipantListParticipant): IContextualMenuItem[] => {\n let menuItems: IContextualMenuItem[] = [];\n\n const participantIsRemovable = participant.isRemovable;\n if (participant.userId !== myUserId && onRemoveParticipant && participantIsRemovable) {\n menuItems.push({\n key: 'remove',\n text: participantItemStrings.removeButtonLabel,\n onClick: () => onRemoveParticipant(participant.userId),\n itemProps: {\n styles: props.styles?.participantItemStyles?.participantSubMenuItemsStyles\n },\n iconProps: {\n iconName: 'ContextMenuRemoveParticipant',\n styles: { root: { lineHeight: 0 } }\n },\n 'data-ui-id': ids.participantListRemoveParticipantButton\n });\n }\n\n if (onFetchParticipantMenuItems) {\n menuItems = onFetchParticipantMenuItems(participant.userId, myUserId, menuItems);\n }\n\n return menuItems;\n },\n [\n ids.participantListRemoveParticipantButton,\n myUserId,\n onFetchParticipantMenuItems,\n onRemoveParticipant,\n props.styles?.participantItemStyles?.participantSubMenuItemsStyles,\n participantItemStrings.removeButtonLabel\n ]\n );\n\n const participantItemStyles = useMemo(\n () => merge(participantListItemStyle, props.styles?.participantItemStyles),\n [props.styles?.participantItemStyles]\n );\n\n /* @conditional-compile-remove(total-participant-count) */\n const overflowParticipantCountString =\n strings?.overflowParticipantCount ?? participantListStrings?.overflowParticipantCount;\n\n return (\n <Stack\n data-ui-id={ids.participantList}\n className={mergeStyles(participantListStyle, props.styles?.root)}\n role={'menu'}\n >\n {displayedParticipants.map((participant: ParticipantListParticipant) =>\n onRenderParticipant\n ? onRenderParticipant(participant)\n : onRenderParticipantDefault(\n participant,\n participantItemStrings,\n myUserId,\n onRenderAvatar,\n createParticipantMenuItems,\n participantItemStyles,\n props.onParticipantClick,\n showParticipantOverflowTooltip,\n participantAriaLabelledBy,\n theme,\n pinnedParticipants\n )\n )}\n {\n /* @conditional-compile-remove(total-participant-count) */ overflowParticipantCountString &&\n totalParticipantCount &&\n totalParticipantCount > displayedParticipants.length && (\n <Text style={{ fontWeight: 400, margin: '0.5rem' }}>\n {_formatString(overflowParticipantCountString, {\n overflowCount: `${totalParticipantCount - displayedParticipants.length}`\n })}\n </Text>\n )\n }\n </Stack>\n );\n};\n"]}
|
1
|
+
{"version":3,"file":"ParticipantList.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ParticipantList.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,IAAI,EAGJ,KAAK,EACL,WAAW,EACX,eAAe,EACf,KAAK,EAEN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,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SACzE,CAAC,CACG,CACR,CAEC,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n Icon,\n IContextualMenuItem,\n IContextualMenuItemStyles,\n merge,\n mergeStyles,\n PersonaPresence,\n Stack,\n Theme\n} from '@fluentui/react';\nimport { Text } from '@fluentui/react';\nimport { useTheme, CallingTheme } from '../theming';\nimport { RaisedHandIcon } from './assets/RaisedHandIcon';\nimport React, { useCallback, useMemo } from 'react';\nimport { useIdentifiers } from '../identifiers';\nimport { useLocale } from '../localization';\nimport {\n BaseCustomStyles,\n CallParticipantListParticipant,\n OnRenderAvatarCallback,\n ParticipantListParticipant\n} from '../types';\nimport { CustomAvatarOptions } from '../types';\nimport {\n formatParticipantStateString,\n ParticipantItem,\n ParticipantItemStrings,\n ParticipantItemStyles\n} from './ParticipantItem';\nimport { iconStyles, participantListItemStyle, participantListStyle } from './styles/ParticipantList.styles';\nimport { _formatString } from '@internal/acs-ui-common';\n\n/**\n * Styles for the {@link ParticipantList} {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantListItemStyles extends ParticipantItemStyles {\n /** Styles applied to the sub-menu of the {@link ParticipantList} {@link ParticipantItem}. */\n participantSubMenuItemsStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Styles for the {@link ParticipantList}.\n *\n * @public\n */\nexport interface ParticipantListStyles extends BaseCustomStyles {\n /** Styles for the {@link ParticipantList} {@link ParticipantItem}. */\n participantItemStyles?: ParticipantListItemStyles;\n}\n\n/* @conditional-compile-remove(total-participant-count) */\n/**\n * Strings for the {@link ParticipantList}.\n *\n * @beta\n */\nexport interface ParticipantListStrings {\n /**\n * String for rendering the count of participants not contained in the displayed participant list\n */\n overflowParticipantCount?: string;\n}\n\n/**\n * A callback for providing custom menu items for each participant in {@link ParticipantList}.\n *\n * @public\n */\nexport type ParticipantMenuItemsCallback = (\n participantUserId: string,\n userId?: string,\n defaultMenuItems?: IContextualMenuItem[]\n) => IContextualMenuItem[];\n\n/**\n * Props for {@link ParticipantList}.\n *\n * @public\n */\nexport type ParticipantListProps = {\n /** Participants in user call or chat */\n participants: ParticipantListParticipant[];\n /** User ID of user */\n myUserId?: string;\n /**\n * If set to `true`, excludes the local participant from the participant list with use of `myUserId` props (required in this case).\n *\n * @defaultValue `false`\n */\n excludeMe?: boolean;\n /** Optional callback to render each participant. If no callback is provided, each participant will be rendered with `ParticipantItem` */\n onRenderParticipant?: (participant: ParticipantListParticipant) => JSX.Element | null;\n /** Optional callback to render the avatar for each participant. This property will have no effect if `onRenderParticipant` is assigned. */\n onRenderAvatar?: OnRenderAvatarCallback;\n /** Optional callback to render the context menu for each participant */\n onRemoveParticipant?: (userId: string) => void;\n /** Optional callback to render custom menu items for each participant. */\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /** Optional callback when rendered ParticipantItem is clicked */\n onParticipantClick?: (participant?: ParticipantListParticipant) => void;\n /** Optional callback to render a context menu to mute a participant */\n onMuteParticipant?: (userId: string) => Promise<void>;\n styles?: ParticipantListStyles;\n /** Optional value to determine if the tooltip should be shown for participants or not */\n showParticipantOverflowTooltip?: boolean;\n /* @conditional-compile-remove(total-participant-count) */\n /** Total number of people in the call. This number can be larger than the remote participant count. */\n totalParticipantCount?: number;\n /* @conditional-compile-remove(total-participant-count) */\n /** Strings for the participant list */\n strings?: ParticipantListStrings;\n /** Optional aria-labelledby prop that prefixes each ParticipantItem aria-label */\n participantAriaLabelledBy?: string;\n /** List of pinned participants */\n pinnedParticipants?: string[];\n};\n\nconst onRenderParticipantDefault = (\n participant: ParticipantListParticipant,\n strings: ParticipantItemStrings,\n myUserId?: string,\n onRenderAvatar?: OnRenderAvatarCallback,\n createParticipantMenuItems?: (participant: ParticipantListParticipant) => IContextualMenuItem[],\n styles?: ParticipantListItemStyles,\n onParticipantClick?: (participant?: ParticipantListParticipant) => void,\n showParticipantOverflowTooltip?: boolean,\n participantAriaLabelledBy?: string,\n theme?: Theme,\n pinnedParticipants?: string[]\n): JSX.Element | null => {\n const callingParticipant = participant as CallParticipantListParticipant;\n\n let presence: PersonaPresence | undefined = undefined;\n if (callingParticipant) {\n presence = PersonaPresence.none;\n }\n\n const menuItems = createParticipantMenuItems && createParticipantMenuItems(participant);\n\n const formatDisplayName = (displayName?: string): string | undefined => {\n if (displayName && strings.attendeeRole) {\n return _formatString(displayName, { AttendeeRole: strings.attendeeRole });\n }\n return displayName;\n };\n const displayName = formatDisplayName(participant.displayName);\n\n const callingPalette = (theme as unknown as CallingTheme).callingPalette;\n const isPinned = pinnedParticipants && pinnedParticipants?.includes(participant.userId);\n const isScreenSharing = callingParticipant?.isScreenSharing;\n const isMuted = callingParticipant?.isMuted;\n const hasRaisedHand = callingParticipant?.raisedHand;\n const isAudioPermitted = callingParticipant?.mediaAccess ? callingParticipant.mediaAccess.isAudioPermitted : true;\n const isVideoPermitted = callingParticipant?.mediaAccess ? callingParticipant.mediaAccess.isVideoPermitted : true;\n\n const shouldRenderParticipantIcon =\n isScreenSharing || isMuted || hasRaisedHand || isPinned || !isAudioPermitted || !isVideoPermitted;\n\n const onRenderIcon = shouldRenderParticipantIcon\n ? () => (\n <Stack horizontal={true} tokens={{ childrenGap: '0.5rem' }}>\n {callingParticipant.raisedHand && (\n <Stack\n horizontal={true}\n tokens={{ childrenGap: '0.2rem' }}\n style={{\n alignItems: 'center',\n padding: '0.1rem 0.2rem',\n backgroundColor: theme?.palette.neutralLighter,\n borderRadius: '0.3rem'\n }}\n >\n {callingParticipant.raisedHand.raisedHandOrderPosition && (\n <Stack.Item>\n <Text>{callingParticipant.raisedHand?.raisedHandOrderPosition}</Text>\n </Stack.Item>\n )}\n <Stack.Item>\n <RaisedHandIcon />\n </Stack.Item>\n </Stack>\n )}\n {callingParticipant.isScreenSharing && (\n <Icon\n iconName=\"ParticipantItemScreenShareStart\"\n className={iconStyles}\n ariaLabel={strings.sharingIconLabel}\n />\n )}\n {callingParticipant.spotlight && <Icon iconName=\"ParticipantItemSpotlighted\" className={iconStyles} />}\n {isPinned && <Icon iconName=\"ParticipantItemPinned\" className={iconStyles} />}\n {callingParticipant.mediaAccess && !callingParticipant.mediaAccess.isVideoPermitted ? (\n <Icon iconName=\"ControlButtonCameraProhibited\" className={iconStyles} ariaLabel={strings.mutedIconLabel} />\n ) : undefined}\n {callingParticipant.mediaAccess && !callingParticipant.mediaAccess?.isAudioPermitted ? (\n <Icon iconName=\"ControlButtonMicProhibited\" className={iconStyles} ariaLabel={strings.mutedIconLabel} />\n ) : undefined}\n {(callingParticipant.mediaAccess ? callingParticipant.mediaAccess.isAudioPermitted : true) &&\n callingParticipant.isMuted ? (\n <Icon iconName=\"ParticipantItemMicOff\" className={iconStyles} ariaLabel={strings.mutedIconLabel} />\n ) : undefined}\n </Stack>\n )\n : () => null;\n\n const onRenderAvatarWithRaiseHand =\n callingParticipant?.raisedHand && onRenderAvatar\n ? (\n userId?: string,\n options?: CustomAvatarOptions,\n defaultOnRender?: (props: CustomAvatarOptions) => JSX.Element\n ) =>\n onRenderAvatar(\n userId,\n { ...options, styles: { root: { border: callingPalette.raiseHandGold } } },\n defaultOnRender\n )\n : onRenderAvatar;\n\n const ariaLabelTemplate =\n (menuItems && menuItems.length > 0 ? strings?.participantItemWithMoreOptionsAriaLabel : undefined) ??\n strings?.participantItemAriaLabel;\n const ariaLabel = _formatString(ariaLabelTemplate ?? '', {\n displayName: displayName ?? '',\n connectionState: formatParticipantStateString(callingParticipant, strings) ?? '',\n mutedState: (callingParticipant.isMuted ? strings?.mutedIconLabel : undefined) ?? '',\n micDisabledState:\n (callingParticipant.mediaAccess?.isAudioPermitted === false ? strings?.micDisabledIconLabel : undefined) ?? '',\n cameraDisabledState:\n (callingParticipant.mediaAccess?.isVideoPermitted === false ? strings?.cameraDisabledIconLabel : undefined) ?? '',\n sharingState: (callingParticipant.isScreenSharing ? strings?.sharingIconLabel : undefined) ?? '',\n handRaisedState:\n (callingParticipant.raisedHand?.raisedHandOrderPosition\n ? _formatString(strings?.handRaisedIconLabel ?? '', {\n position: callingParticipant.raisedHand?.raisedHandOrderPosition?.toString() ?? ''\n })\n : undefined) ?? ''\n });\n\n return (\n <ParticipantItem\n styles={styles}\n key={participant.userId}\n userId={participant.userId}\n displayName={displayName}\n me={myUserId ? participant.userId === myUserId : false}\n menuItems={menuItems}\n presence={presence}\n onRenderIcon={onRenderIcon}\n onRenderAvatar={onRenderAvatarWithRaiseHand}\n onClick={onParticipantClick ? () => onParticipantClick?.(participant) : undefined}\n showParticipantOverflowTooltip={showParticipantOverflowTooltip}\n participantState={callingParticipant.state}\n ariaLabelledBy={participantAriaLabelledBy}\n strings={{\n participantItemAriaLabel: ariaLabel\n }}\n />\n );\n};\n\n/**\n * Sort participants by raised hand order position\n */\nconst sortParticipants = (participants: ParticipantListParticipant[]): ParticipantListParticipant[] => {\n const isParticipantListCallParticipant = function (participant: ParticipantListParticipant): boolean {\n return 'raisedHand' in participant;\n };\n\n participants.sort((a, b) => {\n if (!isParticipantListCallParticipant(a) || !isParticipantListCallParticipant(b)) {\n return 0;\n }\n const callA = a as CallParticipantListParticipant;\n const callB = b as CallParticipantListParticipant;\n if (callA.raisedHand && callB.raisedHand) {\n return callA.raisedHand.raisedHandOrderPosition - callB.raisedHand.raisedHandOrderPosition;\n } else if (callA.raisedHand) {\n return -1;\n } else if (callB.raisedHand) {\n return 1;\n }\n return 0;\n });\n return participants;\n};\n\nconst getParticipantsForDefaultRender = (\n participants: ParticipantListParticipant[],\n excludeMe: boolean,\n myUserId: string | undefined\n): ParticipantListParticipant[] => {\n if (!excludeMe || !myUserId) {\n return [...participants];\n }\n\n const userIndex = participants.map((p) => p.userId).indexOf(myUserId);\n\n if (userIndex === -1) {\n return [...participants];\n }\n\n const remoteParticipants = [...participants];\n remoteParticipants.splice(userIndex, 1);\n\n return remoteParticipants;\n};\n\n/**\n * Component to render all calling or chat participants.\n *\n * By default, each participant is rendered with {@link ParticipantItem}. See {@link ParticipantListProps.onRenderParticipant} to override.\n *\n * @public\n */\nexport const ParticipantList = (props: ParticipantListProps): JSX.Element => {\n const {\n excludeMe = false,\n myUserId,\n participants,\n onRemoveParticipant,\n onRenderAvatar,\n onRenderParticipant,\n onFetchParticipantMenuItems,\n showParticipantOverflowTooltip,\n /* @conditional-compile-remove(total-participant-count) */\n totalParticipantCount,\n /* @conditional-compile-remove(total-participant-count) */\n strings,\n participantAriaLabelledBy,\n pinnedParticipants\n } = props;\n\n const theme = useTheme();\n const ids = useIdentifiers();\n const participantItemStrings = useLocale().strings.participantItem;\n /* @conditional-compile-remove(total-participant-count) */\n const participantListStrings = useLocale().strings.ParticipantList;\n\n const displayedParticipants: ParticipantListParticipant[] = useMemo(() => {\n return onRenderParticipant ? participants : getParticipantsForDefaultRender(participants, excludeMe, myUserId);\n }, [participants, excludeMe, myUserId, onRenderParticipant]);\n\n sortParticipants(displayedParticipants);\n\n const createParticipantMenuItems = useCallback(\n (participant: ParticipantListParticipant): IContextualMenuItem[] => {\n let menuItems: IContextualMenuItem[] = [];\n\n const participantIsRemovable = participant.isRemovable;\n if (participant.userId !== myUserId && onRemoveParticipant && participantIsRemovable) {\n menuItems.push({\n key: 'remove',\n text: participantItemStrings.removeButtonLabel,\n onClick: () => onRemoveParticipant(participant.userId),\n itemProps: {\n styles: props.styles?.participantItemStyles?.participantSubMenuItemsStyles\n },\n iconProps: {\n iconName: 'ContextMenuRemoveParticipant',\n styles: { root: { lineHeight: 0 } }\n },\n 'data-ui-id': ids.participantListRemoveParticipantButton\n });\n }\n\n if (onFetchParticipantMenuItems) {\n menuItems = onFetchParticipantMenuItems(participant.userId, myUserId, menuItems);\n }\n\n return menuItems;\n },\n [\n ids.participantListRemoveParticipantButton,\n myUserId,\n onFetchParticipantMenuItems,\n onRemoveParticipant,\n props.styles?.participantItemStyles?.participantSubMenuItemsStyles,\n participantItemStrings.removeButtonLabel\n ]\n );\n\n const participantItemStyles = useMemo(\n () => merge(participantListItemStyle, props.styles?.participantItemStyles),\n [props.styles?.participantItemStyles]\n );\n\n /* @conditional-compile-remove(total-participant-count) */\n const overflowParticipantCountString =\n strings?.overflowParticipantCount ?? participantListStrings?.overflowParticipantCount;\n\n return (\n <Stack\n data-ui-id={ids.participantList}\n className={mergeStyles(participantListStyle, props.styles?.root)}\n role={'menu'}\n >\n {displayedParticipants.map((participant: ParticipantListParticipant) =>\n onRenderParticipant\n ? onRenderParticipant(participant)\n : onRenderParticipantDefault(\n participant,\n participantItemStrings,\n myUserId,\n onRenderAvatar,\n createParticipantMenuItems,\n participantItemStyles,\n props.onParticipantClick,\n showParticipantOverflowTooltip,\n participantAriaLabelledBy,\n theme,\n pinnedParticipants\n )\n )}\n {\n /* @conditional-compile-remove(total-participant-count) */ overflowParticipantCountString &&\n totalParticipantCount &&\n totalParticipantCount > displayedParticipants.length && (\n <Text style={{ fontWeight: 400, margin: '0.5rem' }}>\n {_formatString(overflowParticipantCountString, {\n overflowCount: `${totalParticipantCount - displayedParticipants.length}`\n })}\n </Text>\n )\n }\n </Stack>\n );\n};\n"]}
|
@@ -21,15 +21,7 @@ import { MeetingReactionOverlay } from './MeetingReactionOverlay';
|
|
21
21
|
export const _RemoteVideoTile = React.memo((props) => {
|
22
22
|
var _a, _b;
|
23
23
|
const { isAvailable, isReceiving = true, // default to true to prevent any breaking change
|
24
|
-
isScreenSharingOn, onCreateRemoteStreamView, onDisposeRemoteStreamView, remoteVideoViewOptions, renderElement, userId, onRenderAvatar, showMuteIndicator, remoteParticipant, participantState, menuKind, isPinned, onPinParticipant, onUnpinParticipant, spotlightedParticipantUserIds, isSpotlighted, onStartSpotlight, onStopSpotlight, maxParticipantsToSpotlight, onMuteParticipant, onUpdateScalingMode, disablePinMenuItem, toggleAnnouncerString, strings, reactionResources, streamId,
|
25
|
-
/* @conditional-compile-remove(media-access) */
|
26
|
-
onForbidAudio,
|
27
|
-
/* @conditional-compile-remove(media-access) */
|
28
|
-
onPermitAudio,
|
29
|
-
/* @conditional-compile-remove(media-access) */
|
30
|
-
onForbidVideo,
|
31
|
-
/* @conditional-compile-remove(media-access) */
|
32
|
-
onPermitVideo } = props;
|
24
|
+
isScreenSharingOn, onCreateRemoteStreamView, onDisposeRemoteStreamView, remoteVideoViewOptions, renderElement, userId, onRenderAvatar, showMuteIndicator, remoteParticipant, participantState, menuKind, isPinned, onPinParticipant, onUnpinParticipant, spotlightedParticipantUserIds, isSpotlighted, onStartSpotlight, onStopSpotlight, maxParticipantsToSpotlight, onMuteParticipant, onUpdateScalingMode, disablePinMenuItem, toggleAnnouncerString, strings, reactionResources, streamId, onForbidAudio, onPermitAudio, onForbidVideo, onPermitVideo } = props;
|
33
25
|
const remoteVideoStreamProps = useMemo(() => ({
|
34
26
|
isMirrored: remoteVideoViewOptions === null || remoteVideoViewOptions === void 0 ? void 0 : remoteVideoViewOptions.isMirrored,
|
35
27
|
isScreenSharingOn,
|
@@ -41,7 +33,6 @@ export const _RemoteVideoTile = React.memo((props) => {
|
|
41
33
|
renderElementExists: !!renderElement,
|
42
34
|
scalingMode: remoteVideoViewOptions === null || remoteVideoViewOptions === void 0 ? void 0 : remoteVideoViewOptions.scalingMode,
|
43
35
|
streamId,
|
44
|
-
/* @conditional-compile-remove(media-access) */
|
45
36
|
isVideoPermitted: remoteParticipant.mediaAccess ? remoteParticipant.mediaAccess.isVideoPermitted : true
|
46
37
|
}), [
|
47
38
|
isAvailable,
|
@@ -54,7 +45,6 @@ export const _RemoteVideoTile = React.memo((props) => {
|
|
54
45
|
renderElement,
|
55
46
|
userId,
|
56
47
|
streamId,
|
57
|
-
/* @conditional-compile-remove(media-access) */
|
58
48
|
remoteParticipant.mediaAccess
|
59
49
|
]);
|
60
50
|
// Handle creating, destroying and updating the video stream as necessary
|
@@ -75,10 +65,10 @@ export const _RemoteVideoTile = React.memo((props) => {
|
|
75
65
|
onStopSpotlight,
|
76
66
|
maxParticipantsToSpotlight,
|
77
67
|
onMuteParticipant,
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
68
|
+
onForbidAudio,
|
69
|
+
onPermitAudio,
|
70
|
+
onForbidVideo,
|
71
|
+
onPermitVideo
|
82
72
|
});
|
83
73
|
const videoTileContextualMenuProps = useMemo(() => {
|
84
74
|
if (menuKind !== 'contextual' || !contextualMenuProps) {
|
@@ -123,9 +113,7 @@ export const _RemoteVideoTile = React.memo((props) => {
|
|
123
113
|
return (React.createElement(Stack, { tabIndex: menuKind === 'drawer' ? 0 : undefined, onKeyDown: menuKind === 'drawer' ? onKeyDown : undefined, style: remoteVideoTileWrapperStyle },
|
124
114
|
React.createElement(VideoTile, Object.assign({ key: userId, userId: userId, initialsName: (_b = formatInitialsName()) !== null && _b !== void 0 ? _b : '', renderElement: renderVideoStreamElement, displayName: displayName, onRenderPlaceholder: onRenderAvatar, isMuted: remoteParticipant.isMuted, raisedHand: remoteParticipant.raisedHand, isSpeaking: remoteParticipant.isSpeaking, showMuteIndicator: showMuteIndicator, personaMinSize: props.personaMinSize, showLabel: props.showLabel, alwaysShowLabelBackground: props.alwaysShowLabelBackground, participantState: participantState }, videoTileContextualMenuProps, { isPinned: props.isPinned, onLongTouch: props.onLongTouch
|
125
115
|
? props.onLongTouch
|
126
|
-
: () => setDrawerMenuItemProps(convertContextualMenuItemsToDrawerMenuItemProps(contextualMenuProps, () => setDrawerMenuItemProps([]))), isSpotlighted: isSpotlighted, overlay: reactionOverlay,
|
127
|
-
/* @conditional-compile-remove(media-access) */
|
128
|
-
mediaAccess: remoteParticipant.mediaAccess })),
|
116
|
+
: () => setDrawerMenuItemProps(convertContextualMenuItemsToDrawerMenuItemProps(contextualMenuProps, () => setDrawerMenuItemProps([]))), isSpotlighted: isSpotlighted, overlay: reactionOverlay, mediaAccess: remoteParticipant.mediaAccess })),
|
129
117
|
drawerMenuItemProps.length > 0 && (React.createElement(Layer, { hostId: props.drawerMenuHostId },
|
130
118
|
React.createElement(Stack, { styles: drawerMenuWrapperStyles },
|
131
119
|
React.createElement(_DrawerMenu, { onLightDismiss: () => setDrawerMenuItemProps([]), items: drawerMenuItemProps, heading: displayName }))))));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RemoteVideoTile.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/RemoteVideoTile.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAwB,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAiB,WAAW,EAAE,MAAM,OAAO,CAAC;AASnD,OAAO,EAAE,WAAW,EAAwB,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AACpH,OAAO,EAEL,uCAAuC,EACxC,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,+BAA+B,EAAE,MAAM,gDAAgD,CAAC;AACjG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,mCAAgC;AAExD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CACxC,CAAC,KA6CA,EAAE,EAAE;;IACH,MAAM,EACJ,WAAW,EACX,WAAW,GAAG,IAAI,EAAE,iDAAiD;IACrE,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EACb,MAAM,EACN,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,6BAA6B,EAC7B,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,0BAA0B,EAC1B,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,E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K,IAAC,MAAM,EAAE,KAAK,CAAC,gBAAgB;YACnC,oBAAC,KAAK,IAAC,MAAM,EAAE,uBAAuB;gBACpC,oBAAC,WAAW,IACV,cAAc,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,EAAE,CAAC,EAChD,KAAK,EAAE,mBAAmB,EAC1B,OAAO,EAAE,WAAW,GACpB,CACI,CACF,CACT,CACK,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,+CAA+C,GAAG,CACtD,mBAA0C,EAC1C,cAA2B,EACH,EAAE;IAC1B,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACzB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC5C,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,GAAG;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,GAAG,EAAE;;gBAChB,MAAA,IAAI,CAAC,OAAO,oDAAI,CAAC;gBACjB,cAAc,aAAd,cAAc,uBAAd,cAAc,EAAI,CAAC;YACrB,CAAC;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IContextualMenuProps, Layer, Stack } from '@fluentui/react';\nimport React, { useMemo } from 'react';\nimport { KeyboardEvent, useCallback } from 'react';\nimport {\n CreateVideoStreamViewResult,\n OnRenderAvatarCallback,\n ParticipantState,\n VideoGalleryRemoteParticipant,\n VideoStreamOptions,\n ViewScalingMode\n} from '../types';\nimport { _DrawerMenu, _DrawerMenuItemProps } from './Drawer';\nimport { StreamMedia } from './StreamMedia';\nimport { VideoGalleryStrings } from './VideoGallery';\nimport { drawerMenuWrapperStyles, remoteVideoTileWrapperStyle } from './VideoGallery/styles/RemoteVideoTile.styles';\nimport {\n RemoteVideoStreamLifecycleMaintainerProps,\n useRemoteVideoStreamLifecycleMaintainer\n} from './VideoGallery/useVideoStreamLifecycleMaintainer';\nimport { useVideoTileContextualMenuProps } from './VideoGallery/useVideoTileContextualMenuProps';\nimport { VideoTile } from './VideoTile';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { ReactionResources } from '../types/ReactionTypes';\nimport { MeetingReactionOverlay } from './MeetingReactionOverlay';\n\n/**\n * A memoized version of VideoTile for rendering remote participants. React.memo is used for a performance\n * boost by memoizing the same rendered component to avoid rerendering a VideoTile when its position in the\n * array changes causing a rerender in the parent component. https://reactjs.org/docs/react-api.html#reactmemo\n *\n * @internal\n */\nexport const _RemoteVideoTile = React.memo(\n (props: {\n userId: string;\n remoteParticipant: VideoGalleryRemoteParticipant;\n onCreateRemoteStreamView?: (\n userId: string,\n options?: VideoStreamOptions\n ) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeRemoteStreamView?: (userId: string) => Promise<void>;\n isAvailable?: boolean;\n isReceiving?: boolean;\n streamId?: number;\n isScreenSharingOn?: boolean; // TODO: Remove this once onDisposeRemoteStreamView no longer disposes of screen share stream\n renderElement?: HTMLElement;\n remoteVideoViewOptions?: VideoStreamOptions;\n onRenderAvatar?: OnRenderAvatarCallback;\n showMuteIndicator?: boolean;\n showLabel?: boolean;\n alwaysShowLabelBackground?: boolean;\n personaMinSize?: number;\n strings: VideoGalleryStrings;\n participantState?: ParticipantState;\n menuKind?: 'contextual' | 'drawer';\n drawerMenuHostId?: string;\n onPinParticipant?: (userId: string) => void;\n onUnpinParticipant?: (userId: string) => void;\n onUpdateScalingMode?: (userId: string, scalingMode: ViewScalingMode) => void;\n isPinned?: boolean;\n spotlightedParticipantUserIds?: string[];\n isSpotlighted?: boolean;\n onStartSpotlight?: (userIds: string[]) => void;\n onStopSpotlight?: (userIds: string[]) => void;\n maxParticipantsToSpotlight?: number;\n onMuteParticipant?: (userId: string) => void;\n disablePinMenuItem?: boolean;\n toggleAnnouncerString?: (announcerString: string) => void;\n reactionResources?: ReactionResources;\n onLongTouch?: (() => void) | undefined;\n /* @conditional-compile-remove(media-access) */\n onForbidAudio?: (userIds: string[]) => Promise<void>;\n /* @conditional-compile-remove(media-access) */\n onPermitAudio?: (userIds: string[]) => Promise<void>;\n /* @conditional-compile-remove(media-access) */\n onForbidVideo?: (userIds: string[]) => Promise<void>;\n /* @conditional-compile-remove(media-access) */\n onPermitVideo?: (userIds: string[]) => Promise<void>;\n }) => {\n const {\n isAvailable,\n isReceiving = true, // default to true to prevent any breaking change\n isScreenSharingOn,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteVideoViewOptions,\n renderElement,\n userId,\n onRenderAvatar,\n showMuteIndicator,\n remoteParticipant,\n participantState,\n menuKind,\n isPinned,\n onPinParticipant,\n onUnpinParticipant,\n spotlightedParticipantUserIds,\n isSpotlighted,\n onStartSpotlight,\n onStopSpotlight,\n maxParticipantsToSpotlight,\n onMuteParticipant,\n onUpdateScalingMode,\n disablePinMenuItem,\n toggleAnnouncerString,\n strings,\n reactionResources,\n streamId,\n /* @conditional-compile-remove(media-access) */\n onForbidAudio,\n /* @conditional-compile-remove(media-access) */\n onPermitAudio,\n /* @conditional-compile-remove(media-access) */\n onForbidVideo,\n /* @conditional-compile-remove(media-access) */\n onPermitVideo\n } = props;\n\n const remoteVideoStreamProps: RemoteVideoStreamLifecycleMaintainerProps = useMemo(\n () => ({\n isMirrored: remoteVideoViewOptions?.isMirrored,\n isScreenSharingOn,\n isStreamAvailable: isAvailable,\n isStreamReceiving: isReceiving,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteParticipantId: userId,\n renderElementExists: !!renderElement,\n scalingMode: remoteVideoViewOptions?.scalingMode,\n streamId,\n /* @conditional-compile-remove(media-access) */\n isVideoPermitted: remoteParticipant.mediaAccess ? remoteParticipant.mediaAccess.isVideoPermitted : true\n }),\n [\n isAvailable,\n isReceiving,\n isScreenSharingOn,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteVideoViewOptions?.isMirrored,\n remoteVideoViewOptions?.scalingMode,\n renderElement,\n userId,\n streamId,\n /* @conditional-compile-remove(media-access) */\n remoteParticipant.mediaAccess\n ]\n );\n\n // Handle creating, destroying and updating the video stream as necessary\n const createVideoStreamResult = useRemoteVideoStreamLifecycleMaintainer(remoteVideoStreamProps);\n const contextualMenuProps = useVideoTileContextualMenuProps({\n participant: remoteParticipant,\n view: createVideoStreamResult?.view,\n strings: { ...props.strings },\n isPinned,\n onPinParticipant,\n onUnpinParticipant,\n onUpdateScalingMode,\n disablePinMenuItem,\n toggleAnnouncerString,\n spotlightedParticipantUserIds,\n isSpotlighted,\n onStartSpotlight,\n onStopSpotlight,\n maxParticipantsToSpotlight,\n onMuteParticipant,\n /* @conditional-compile-remove(media-access) */ onForbidAudio,\n /* @conditional-compile-remove(media-access) */ onPermitAudio,\n /* @conditional-compile-remove(media-access) */ onForbidVideo,\n /* @conditional-compile-remove(media-access) */ onPermitVideo\n });\n\n const videoTileContextualMenuProps = useMemo(() => {\n if (menuKind !== 'contextual' || !contextualMenuProps) {\n return {};\n }\n return {\n contextualMenu: contextualMenuProps\n };\n }, [contextualMenuProps, menuKind]);\n\n const showLoadingIndicator = isAvailable && isReceiving === false && participantState !== 'Disconnected';\n const isReconnecting = participantState === 'Reconnecting';\n\n const [drawerMenuItemProps, setDrawerMenuItemProps] = React.useState<_DrawerMenuItemProps[]>([]);\n\n const renderVideoStreamElement = useMemo(() => {\n // Checking if renderElement is well defined or not as calling SDK has a number of video streams limitation which\n // implies that, after their threshold, all streams have no child (blank video)\n if ((!renderElement || !renderElement.childElementCount) && !isReconnecting) {\n // Returning `undefined` results in the placeholder with avatar being shown\n return undefined;\n }\n\n return (\n <StreamMedia\n videoStreamElement={renderElement ?? null}\n loadingState={showLoadingIndicator ? 'loading' : isReconnecting ? 'reconnecting' : 'none'}\n />\n );\n }, [isReconnecting, renderElement, showLoadingIndicator]);\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n setDrawerMenuItemProps(\n convertContextualMenuItemsToDrawerMenuItemProps(contextualMenuProps, () => setDrawerMenuItemProps([]))\n );\n }\n },\n [setDrawerMenuItemProps, contextualMenuProps]\n );\n\n const attendeeRoleString = props.strings?.attendeeRole;\n\n const formatDisplayName = (displayName: string, role: string): string => {\n if (displayName && role) {\n return _formatString(displayName, { AttendeeRole: role });\n }\n return displayName;\n };\n const displayName = formatDisplayName(\n remoteParticipant.displayName ? remoteParticipant.displayName : strings.displayNamePlaceholder,\n attendeeRoleString\n );\n const formatInitialsName = (): string | undefined => {\n if (remoteParticipant.displayName && attendeeRoleString) {\n return _formatString(remoteParticipant.displayName, { AttendeeRole: attendeeRoleString });\n }\n return remoteParticipant.displayName;\n };\n\n const reactionOverlay = reactionResources && (\n <MeetingReactionOverlay\n overlayMode=\"grid-tiles\"\n reaction={remoteParticipant.reaction}\n reactionResources={reactionResources}\n />\n );\n\n return (\n <Stack\n tabIndex={menuKind === 'drawer' ? 0 : undefined}\n onKeyDown={menuKind === 'drawer' ? onKeyDown : undefined}\n style={remoteVideoTileWrapperStyle}\n >\n <VideoTile\n key={userId}\n userId={userId}\n initialsName={formatInitialsName() ?? ''}\n renderElement={renderVideoStreamElement}\n displayName={displayName}\n onRenderPlaceholder={onRenderAvatar}\n isMuted={remoteParticipant.isMuted}\n raisedHand={remoteParticipant.raisedHand}\n isSpeaking={remoteParticipant.isSpeaking}\n showMuteIndicator={showMuteIndicator}\n personaMinSize={props.personaMinSize}\n showLabel={props.showLabel}\n alwaysShowLabelBackground={props.alwaysShowLabelBackground}\n participantState={participantState}\n {...videoTileContextualMenuProps}\n isPinned={props.isPinned}\n onLongTouch={\n props.onLongTouch\n ? props.onLongTouch\n : () =>\n setDrawerMenuItemProps(\n convertContextualMenuItemsToDrawerMenuItemProps(contextualMenuProps, () =>\n setDrawerMenuItemProps([])\n )\n )\n }\n isSpotlighted={isSpotlighted}\n overlay={reactionOverlay}\n /* @conditional-compile-remove(media-access) */\n mediaAccess={remoteParticipant.mediaAccess}\n />\n {drawerMenuItemProps.length > 0 && (\n <Layer hostId={props.drawerMenuHostId}>\n <Stack styles={drawerMenuWrapperStyles}>\n <_DrawerMenu\n onLightDismiss={() => setDrawerMenuItemProps([])}\n items={drawerMenuItemProps}\n heading={displayName}\n />\n </Stack>\n </Layer>\n )}\n </Stack>\n );\n }\n);\n\nconst convertContextualMenuItemsToDrawerMenuItemProps = (\n contextualMenuProps?: IContextualMenuProps,\n onLightDismiss?: () => void\n): _DrawerMenuItemProps[] => {\n if (!contextualMenuProps) {\n return [];\n }\n return contextualMenuProps.items.map((item) => {\n return {\n itemKey: item.key,\n text: item.text,\n iconProps: item.iconProps,\n disabled: item.disabled,\n onItemClick: () => {\n item.onClick?.();\n onLightDismiss?.();\n }\n };\n });\n};\n"]}
|
1
|
+
{"version":3,"file":"RemoteVideoTile.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/RemoteVideoTile.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAwB,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAiB,WAAW,EAAE,MAAM,OAAO,CAAC;AASnD,OAAO,EAAE,WAAW,EAAwB,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AACpH,OAAO,EAEL,uCAAuC,EACxC,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,+BAA+B,EAAE,MAAM,gDAAgD,CAAC;AACjG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,mC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ation.\n// Licensed under the MIT License.\n\nimport { IContextualMenuProps, Layer, Stack } from '@fluentui/react';\nimport React, { useMemo } from 'react';\nimport { KeyboardEvent, useCallback } from 'react';\nimport {\n CreateVideoStreamViewResult,\n OnRenderAvatarCallback,\n ParticipantState,\n VideoGalleryRemoteParticipant,\n VideoStreamOptions,\n ViewScalingMode\n} from '../types';\nimport { _DrawerMenu, _DrawerMenuItemProps } from './Drawer';\nimport { StreamMedia } from './StreamMedia';\nimport { VideoGalleryStrings } from './VideoGallery';\nimport { drawerMenuWrapperStyles, remoteVideoTileWrapperStyle } from './VideoGallery/styles/RemoteVideoTile.styles';\nimport {\n RemoteVideoStreamLifecycleMaintainerProps,\n useRemoteVideoStreamLifecycleMaintainer\n} from './VideoGallery/useVideoStreamLifecycleMaintainer';\nimport { useVideoTileContextualMenuProps } from './VideoGallery/useVideoTileContextualMenuProps';\nimport { VideoTile } from './VideoTile';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { ReactionResources } from '../types/ReactionTypes';\nimport { MeetingReactionOverlay } from './MeetingReactionOverlay';\n\n/**\n * A memoized version of VideoTile for rendering remote participants. React.memo is used for a performance\n * boost by memoizing the same rendered component to avoid rerendering a VideoTile when its position in the\n * array changes causing a rerender in the parent component. https://reactjs.org/docs/react-api.html#reactmemo\n *\n * @internal\n */\nexport const _RemoteVideoTile = React.memo(\n (props: {\n userId: string;\n remoteParticipant: VideoGalleryRemoteParticipant;\n onCreateRemoteStreamView?: (\n userId: string,\n options?: VideoStreamOptions\n ) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeRemoteStreamView?: (userId: string) => Promise<void>;\n isAvailable?: boolean;\n isReceiving?: boolean;\n streamId?: number;\n isScreenSharingOn?: boolean; // TODO: Remove this once onDisposeRemoteStreamView no longer disposes of screen share stream\n renderElement?: HTMLElement;\n remoteVideoViewOptions?: VideoStreamOptions;\n onRenderAvatar?: OnRenderAvatarCallback;\n showMuteIndicator?: boolean;\n showLabel?: boolean;\n alwaysShowLabelBackground?: boolean;\n personaMinSize?: number;\n strings: VideoGalleryStrings;\n participantState?: ParticipantState;\n menuKind?: 'contextual' | 'drawer';\n drawerMenuHostId?: string;\n onPinParticipant?: (userId: string) => void;\n onUnpinParticipant?: (userId: string) => void;\n onUpdateScalingMode?: (userId: string, scalingMode: ViewScalingMode) => void;\n isPinned?: boolean;\n spotlightedParticipantUserIds?: string[];\n isSpotlighted?: boolean;\n onStartSpotlight?: (userIds: string[]) => void;\n onStopSpotlight?: (userIds: string[]) => void;\n maxParticipantsToSpotlight?: number;\n onMuteParticipant?: (userId: string) => void;\n disablePinMenuItem?: boolean;\n toggleAnnouncerString?: (announcerString: string) => void;\n reactionResources?: ReactionResources;\n onLongTouch?: (() => void) | undefined;\n onForbidAudio?: (userIds: string[]) => Promise<void>;\n onPermitAudio?: (userIds: string[]) => Promise<void>;\n onForbidVideo?: (userIds: string[]) => Promise<void>;\n onPermitVideo?: (userIds: string[]) => Promise<void>;\n }) => {\n const {\n isAvailable,\n isReceiving = true, // default to true to prevent any breaking change\n isScreenSharingOn,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteVideoViewOptions,\n renderElement,\n userId,\n onRenderAvatar,\n showMuteIndicator,\n remoteParticipant,\n participantState,\n menuKind,\n isPinned,\n onPinParticipant,\n onUnpinParticipant,\n spotlightedParticipantUserIds,\n isSpotlighted,\n onStartSpotlight,\n onStopSpotlight,\n maxParticipantsToSpotlight,\n onMuteParticipant,\n onUpdateScalingMode,\n disablePinMenuItem,\n toggleAnnouncerString,\n strings,\n reactionResources,\n streamId,\n onForbidAudio,\n onPermitAudio,\n onForbidVideo,\n onPermitVideo\n } = props;\n\n const remoteVideoStreamProps: RemoteVideoStreamLifecycleMaintainerProps = useMemo(\n () => ({\n isMirrored: remoteVideoViewOptions?.isMirrored,\n isScreenSharingOn,\n isStreamAvailable: isAvailable,\n isStreamReceiving: isReceiving,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteParticipantId: userId,\n renderElementExists: !!renderElement,\n scalingMode: remoteVideoViewOptions?.scalingMode,\n streamId,\n isVideoPermitted: remoteParticipant.mediaAccess ? remoteParticipant.mediaAccess.isVideoPermitted : true\n }),\n [\n isAvailable,\n isReceiving,\n isScreenSharingOn,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteVideoViewOptions?.isMirrored,\n remoteVideoViewOptions?.scalingMode,\n renderElement,\n userId,\n streamId,\n remoteParticipant.mediaAccess\n ]\n );\n\n // Handle creating, destroying and updating the video stream as necessary\n const createVideoStreamResult = useRemoteVideoStreamLifecycleMaintainer(remoteVideoStreamProps);\n const contextualMenuProps = useVideoTileContextualMenuProps({\n participant: remoteParticipant,\n view: createVideoStreamResult?.view,\n strings: { ...props.strings },\n isPinned,\n onPinParticipant,\n onUnpinParticipant,\n onUpdateScalingMode,\n disablePinMenuItem,\n toggleAnnouncerString,\n spotlightedParticipantUserIds,\n isSpotlighted,\n onStartSpotlight,\n onStopSpotlight,\n maxParticipantsToSpotlight,\n onMuteParticipant,\n onForbidAudio,\n onPermitAudio,\n onForbidVideo,\n onPermitVideo\n });\n\n const videoTileContextualMenuProps = useMemo(() => {\n if (menuKind !== 'contextual' || !contextualMenuProps) {\n return {};\n }\n return {\n contextualMenu: contextualMenuProps\n };\n }, [contextualMenuProps, menuKind]);\n\n const showLoadingIndicator = isAvailable && isReceiving === false && participantState !== 'Disconnected';\n const isReconnecting = participantState === 'Reconnecting';\n\n const [drawerMenuItemProps, setDrawerMenuItemProps] = React.useState<_DrawerMenuItemProps[]>([]);\n\n const renderVideoStreamElement = useMemo(() => {\n // Checking if renderElement is well defined or not as calling SDK has a number of video streams limitation which\n // implies that, after their threshold, all streams have no child (blank video)\n if ((!renderElement || !renderElement.childElementCount) && !isReconnecting) {\n // Returning `undefined` results in the placeholder with avatar being shown\n return undefined;\n }\n\n return (\n <StreamMedia\n videoStreamElement={renderElement ?? null}\n loadingState={showLoadingIndicator ? 'loading' : isReconnecting ? 'reconnecting' : 'none'}\n />\n );\n }, [isReconnecting, renderElement, showLoadingIndicator]);\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n setDrawerMenuItemProps(\n convertContextualMenuItemsToDrawerMenuItemProps(contextualMenuProps, () => setDrawerMenuItemProps([]))\n );\n }\n },\n [setDrawerMenuItemProps, contextualMenuProps]\n );\n\n const attendeeRoleString = props.strings?.attendeeRole;\n\n const formatDisplayName = (displayName: string, role: string): string => {\n if (displayName && role) {\n return _formatString(displayName, { AttendeeRole: role });\n }\n return displayName;\n };\n const displayName = formatDisplayName(\n remoteParticipant.displayName ? remoteParticipant.displayName : strings.displayNamePlaceholder,\n attendeeRoleString\n );\n const formatInitialsName = (): string | undefined => {\n if (remoteParticipant.displayName && attendeeRoleString) {\n return _formatString(remoteParticipant.displayName, { AttendeeRole: attendeeRoleString });\n }\n return remoteParticipant.displayName;\n };\n\n const reactionOverlay = reactionResources && (\n <MeetingReactionOverlay\n overlayMode=\"grid-tiles\"\n reaction={remoteParticipant.reaction}\n reactionResources={reactionResources}\n />\n );\n\n return (\n <Stack\n tabIndex={menuKind === 'drawer' ? 0 : undefined}\n onKeyDown={menuKind === 'drawer' ? onKeyDown : undefined}\n style={remoteVideoTileWrapperStyle}\n >\n <VideoTile\n key={userId}\n userId={userId}\n initialsName={formatInitialsName() ?? ''}\n renderElement={renderVideoStreamElement}\n displayName={displayName}\n onRenderPlaceholder={onRenderAvatar}\n isMuted={remoteParticipant.isMuted}\n raisedHand={remoteParticipant.raisedHand}\n isSpeaking={remoteParticipant.isSpeaking}\n showMuteIndicator={showMuteIndicator}\n personaMinSize={props.personaMinSize}\n showLabel={props.showLabel}\n alwaysShowLabelBackground={props.alwaysShowLabelBackground}\n participantState={participantState}\n {...videoTileContextualMenuProps}\n isPinned={props.isPinned}\n onLongTouch={\n props.onLongTouch\n ? props.onLongTouch\n : () =>\n setDrawerMenuItemProps(\n convertContextualMenuItemsToDrawerMenuItemProps(contextualMenuProps, () =>\n setDrawerMenuItemProps([])\n )\n )\n }\n isSpotlighted={isSpotlighted}\n overlay={reactionOverlay}\n mediaAccess={remoteParticipant.mediaAccess}\n />\n {drawerMenuItemProps.length > 0 && (\n <Layer hostId={props.drawerMenuHostId}>\n <Stack styles={drawerMenuWrapperStyles}>\n <_DrawerMenu\n onLightDismiss={() => setDrawerMenuItemProps([])}\n items={drawerMenuItemProps}\n heading={displayName}\n />\n </Stack>\n </Layer>\n )}\n </Stack>\n );\n }\n);\n\nconst convertContextualMenuItemsToDrawerMenuItemProps = (\n contextualMenuProps?: IContextualMenuProps,\n onLightDismiss?: () => void\n): _DrawerMenuItemProps[] => {\n if (!contextualMenuProps) {\n return [];\n }\n return contextualMenuProps.items.map((item) => {\n return {\n itemKey: item.key,\n text: item.text,\n iconProps: item.iconProps,\n disabled: item.disabled,\n onItemClick: () => {\n item.onClick?.();\n onLightDismiss?.();\n }\n };\n });\n};\n"]}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT License.
|
3
3
|
/* @conditional-compile-remove(together-mode) */
|
4
|
-
import React, { useMemo, useState, memo } from 'react';
|
4
|
+
import React, { useMemo, useState, memo, useEffect } from 'react';
|
5
5
|
/* @conditional-compile-remove(together-mode) */
|
6
6
|
import { moveAnimationStyles, spriteAnimationStyles } from './styles/ReactionOverlay.style';
|
7
7
|
/* @conditional-compile-remove(together-mode) */
|
@@ -13,7 +13,7 @@ import { getEmojiResource } from './VideoGallery/utils/videoGalleryLayoutUtils';
|
|
13
13
|
/* @conditional-compile-remove(together-mode) */
|
14
14
|
import { useLocale } from '../localization';
|
15
15
|
/* @conditional-compile-remove(together-mode) */
|
16
|
-
import { calculateScaledSize, getTogetherModeParticipantOverlayStyle, REACTION_MAX_TRAVEL_HEIGHT, REACTION_TRAVEL_HEIGHT, setTogetherModeSeatPositionStyle, togetherModeIconStyle, togetherModeParticipantDisplayName, togetherModeParticipantEmojiSpriteStyle, togetherModeParticipantStatusContainer } from './styles/TogetherMode.styles';
|
16
|
+
import { calculateScaledSize, getTogetherModeParticipantOverlayStyle, participantStatusTransitionStyle, REACTION_MAX_TRAVEL_HEIGHT, REACTION_TRAVEL_HEIGHT, setTogetherModeSeatPositionStyle, togetherModeIconStyle, togetherModeParticipantDisplayName, togetherModeParticipantEmojiSpriteStyle, togetherModeParticipantStatusContainer } from './styles/TogetherMode.styles';
|
17
17
|
/* @conditional-compile-remove(together-mode) */
|
18
18
|
import { useTheme } from '../theming';
|
19
19
|
/* @conditional-compile-remove(together-mode) */
|
@@ -36,7 +36,7 @@ export const TogetherModeOverlay = memo((props) => {
|
|
36
36
|
* It updates the togetherModeParticipantStatus state when there's a change in the remoteParticipants, localParticipant,
|
37
37
|
* raisedHand, spotlight, isMuted, displayName, or hoveredParticipantID.
|
38
38
|
*/
|
39
|
-
useMemo(() => {
|
39
|
+
const updatedParticipantStatus = useMemo(() => {
|
40
40
|
const allParticipants = [...remoteParticipants, localParticipant];
|
41
41
|
const participantsWithVideoAvailable = allParticipants.filter((p) => { var _a; return ((_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) && togetherModeSeatPositions[p.userId]; });
|
42
42
|
const updatedSignals = {};
|
@@ -59,16 +59,13 @@ export const TogetherModeOverlay = memo((props) => {
|
|
59
59
|
}
|
60
60
|
// This is used to remove the participants bounding box from the DOM when they are no longer in the stream
|
61
61
|
const participantsNotInTogetherModeStream = Object.keys(togetherModeParticipantStatus).filter((id) => !updatedSignals[id]);
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
participantsNotInTogetherModeStream.forEach((id) => {
|
66
|
-
delete newSignals[id];
|
67
|
-
});
|
68
|
-
const hasChanges = Object.keys(newSignals).some((key) => JSON.stringify(newSignals[key]) !== JSON.stringify(prevSignals[key]) ||
|
69
|
-
newSignalsLength !== Object.keys(prevSignals).length);
|
70
|
-
return hasChanges ? newSignals : prevSignals;
|
62
|
+
const newSignals = Object.assign(Object.assign({}, togetherModeParticipantStatus), updatedSignals);
|
63
|
+
participantsNotInTogetherModeStream.forEach((id) => {
|
64
|
+
delete newSignals[id];
|
71
65
|
});
|
66
|
+
const hasSignalingChange = Object.keys(newSignals).some((key) => JSON.stringify(newSignals[key]) !== JSON.stringify(togetherModeParticipantStatus[key]));
|
67
|
+
const updateTogetherModeParticipantStatusState = hasSignalingChange || Object.keys(newSignals).length !== Object.keys(togetherModeParticipantStatus).length;
|
68
|
+
return updateTogetherModeParticipantStatusState ? newSignals : togetherModeParticipantStatus;
|
72
69
|
}, [
|
73
70
|
remoteParticipants,
|
74
71
|
localParticipant,
|
@@ -78,29 +75,24 @@ export const TogetherModeOverlay = memo((props) => {
|
|
78
75
|
locale.strings.videoGallery.displayNamePlaceholder,
|
79
76
|
hoveredParticipantID
|
80
77
|
]);
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
*/
|
88
|
-
useMemo(() => {
|
89
|
-
const removedVisibleParticipants = Object.keys(togetherModeParticipantStatus).filter((participantId) => !togetherModeSeatPositions[participantId]);
|
90
|
-
setTogetherModeParticipantStatus((prevSignals) => {
|
91
|
-
const newSignals = Object.assign({}, prevSignals);
|
92
|
-
removedVisibleParticipants.forEach((participantId) => {
|
93
|
-
delete newSignals[participantId];
|
94
|
-
});
|
95
|
-
// Trigger a re-render only if changes occurred
|
96
|
-
const hasChanges = Object.keys(newSignals).length !== Object.keys(prevSignals).length;
|
97
|
-
return hasChanges ? newSignals : prevSignals;
|
98
|
-
});
|
99
|
-
}, [togetherModeParticipantStatus, togetherModeSeatPositions]);
|
78
|
+
useEffect(() => {
|
79
|
+
if (hoveredParticipantID && !updatedParticipantStatus[hoveredParticipantID]) {
|
80
|
+
setHoveredParticipantID('');
|
81
|
+
}
|
82
|
+
setTogetherModeParticipantStatus(updatedParticipantStatus);
|
83
|
+
}, [hoveredParticipantID, updatedParticipantStatus]);
|
100
84
|
return (React.createElement("div", { style: { position: 'absolute', width: '100%', height: '100%' } }, Object.values(togetherModeParticipantStatus).map((participantStatus) => {
|
101
85
|
var _a, _b;
|
102
86
|
return participantStatus.id && (React.createElement("div", { key: participantStatus.id, style: Object.assign({}, getTogetherModeParticipantOverlayStyle(participantStatus.seatPositionStyle)), onMouseEnter: () => setHoveredParticipantID(participantStatus.id), onMouseLeave: () => setHoveredParticipantID('') },
|
103
87
|
React.createElement("div", null,
|
88
|
+
participantStatus.showDisplayName && (React.createElement("div", { style: Object.assign({}, participantStatusTransitionStyle) },
|
89
|
+
React.createElement("div", { style: Object.assign({}, togetherModeParticipantStatusContainer(callingPalette.videoTileLabelBackgroundLight, theme.effects.roundedCorner4)) },
|
90
|
+
participantStatus.isHandRaised && React.createElement(RaisedHandIcon, null),
|
91
|
+
participantStatus.showDisplayName && (React.createElement(Text, { style: Object.assign({}, togetherModeParticipantDisplayName(hoveredParticipantID === participantStatus.id, parseFloat(participantStatus.seatPositionStyle.seatPosition.width), participantStatus.displayName ? theme.palette.neutralSecondary : 'inherit')) }, participantStatus.displayName)),
|
92
|
+
participantStatus.isMuted && (React.createElement(Stack, { className: mergeStyles(togetherModeIconStyle) },
|
93
|
+
React.createElement(Icon, { iconName: "VideoTileMicOff" }))),
|
94
|
+
participantStatus.isSpotlighted && (React.createElement(Stack, { className: mergeStyles(togetherModeIconStyle) },
|
95
|
+
React.createElement(Icon, { iconName: "VideoTileSpotlighted" })))))),
|
104
96
|
((_a = participantStatus.reaction) === null || _a === void 0 ? void 0 : _a.reactionType) && (
|
105
97
|
// First div - Section that fixes the travel height and applies the movement animation
|
106
98
|
// Second div - Responsible for ensuring the sprite emoji is always centered in the participant seat position
|
@@ -109,15 +101,7 @@ export const TogetherModeOverlay = memo((props) => {
|
|
109
101
|
REACTION_MAX_TRAVEL_HEIGHT, parseFloat(participantStatus.seatPositionStyle.seatPosition.height) * REACTION_TRAVEL_HEIGHT) },
|
110
102
|
React.createElement("div", { style: Object.assign({}, togetherModeParticipantEmojiSpriteStyle(emojiSize, participantStatus.scaledSize || 1, participantStatus.seatPositionStyle.seatPosition.width)) },
|
111
103
|
React.createElement("div", { style: spriteAnimationStyles(REACTION_NUMBER_OF_ANIMATION_FRAMES, participantStatus.scaledSize || 1, (_b = (participantStatus.reaction &&
|
112
|
-
getEmojiResource(participantStatus === null || participantStatus === void 0 ? void 0 : participantStatus.reaction.reactionType, reactionResources))) !== null && _b !== void 0 ? _b : '') }))))
|
113
|
-
participantStatus.showDisplayName && (React.createElement("div", null,
|
114
|
-
React.createElement("div", { style: Object.assign({}, togetherModeParticipantStatusContainer(callingPalette.videoTileLabelBackgroundLight, theme.effects.roundedCorner4)) },
|
115
|
-
participantStatus.isHandRaised && React.createElement(RaisedHandIcon, null),
|
116
|
-
participantStatus.showDisplayName && (React.createElement(Text, { style: Object.assign({}, togetherModeParticipantDisplayName(hoveredParticipantID === participantStatus.id, parseFloat(participantStatus.seatPositionStyle.seatPosition.width), participantStatus.displayName ? theme.palette.neutralSecondary : 'inherit')) }, participantStatus.displayName)),
|
117
|
-
participantStatus.isMuted && (React.createElement(Stack, { className: mergeStyles(togetherModeIconStyle) },
|
118
|
-
React.createElement(Icon, { iconName: "VideoTileMicOff" }))),
|
119
|
-
participantStatus.isSpotlighted && (React.createElement(Stack, { className: mergeStyles(togetherModeIconStyle) },
|
120
|
-
React.createElement(Icon, { iconName: "VideoTileSpotlighted" })))))))));
|
104
|
+
getEmojiResource(participantStatus === null || participantStatus === void 0 ? void 0 : participantStatus.reaction.reactionType, reactionResources))) !== null && _b !== void 0 ? _b : '') })))))));
|
121
105
|
})));
|
122
106
|
});
|
123
107
|
//# sourceMappingURL=TogetherModeOverlay.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TogetherModeOverlay.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/TogetherModeOverlay.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,gDAAgD;AAChD,OAAO,KAAK,EAAE,EAAE,OAAO,EA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AK,IAAC,SAAS,EAAE,WAAW,CAAC,qBAAqB,CAAC;4BAClD,oBAAC,IAAI,IAAC,QAAQ,EAAC,sBAAsB,GAAG,CAClC,CACT,CACG,CACF,CACP,CACG,CACF,CACP,CAAA;KAAA,CACJ,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(together-mode) */\nimport React, { useMemo, useState, memo } from 'react';\n/* @conditional-compile-remove(together-mode) */\nimport {\n Reaction,\n ReactionResources,\n VideoGalleryTogetherModeParticipantPosition,\n VideoGalleryLocalParticipant,\n VideoGalleryRemoteParticipant\n} from '../types';\n/* @conditional-compile-remove(together-mode) */\nimport { moveAnimationStyles, spriteAnimationStyles } from './styles/ReactionOverlay.style';\n/* @conditional-compile-remove(together-mode) */\nimport { REACTION_NUMBER_OF_ANIMATION_FRAMES } from './VideoGallery/utils/reactionUtils';\n/* @conditional-compile-remove(together-mode) */\nimport { Icon, mergeStyles, Stack, Text } from '@fluentui/react';\n/* @conditional-compile-remove(together-mode) */\nimport { getEmojiResource } from './VideoGallery/utils/videoGalleryLayoutUtils';\n/* @conditional-compile-remove(together-mode) */\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(together-mode) */\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\n/* @conditional-compile-remove(together-mode) */\nimport {\n calculateScaledSize,\n getTogetherModeParticipantOverlayStyle,\n REACTION_MAX_TRAVEL_HEIGHT,\n REACTION_TRAVEL_HEIGHT,\n setTogetherModeSeatPositionStyle,\n togetherModeIconStyle,\n togetherModeParticipantDisplayName,\n togetherModeParticipantEmojiSpriteStyle,\n togetherModeParticipantStatusContainer,\n TogetherModeSeatStyle\n} from './styles/TogetherMode.styles';\n/* @conditional-compile-remove(together-mode) */\nimport { CallingTheme, useTheme } from '../theming';\n/* @conditional-compile-remove(together-mode) */\nimport { RaisedHandIcon } from './assets/RaisedHandIcon';\n/* @conditional-compile-remove(together-mode) */\nimport { _pxToRem } from '@internal/acs-ui-common';\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * Signaling action overlay component props\n * @internal\n */\ntype TogetherModeParticipantStatus = {\n reaction?: Reaction;\n scaledSize?: number;\n isHandRaised?: boolean;\n isSpotlighted?: boolean;\n isMuted?: boolean;\n id: string;\n seatPositionStyle: TogetherModeSeatStyle;\n displayName: string;\n showDisplayName: boolean;\n};\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * TogetherModeOverlay component renders an empty JSX element.\n *\n * @returns {JSX.Element} An empty JSX element.\n */\nexport const TogetherModeOverlay = memo(\n (props: {\n emojiSize: number;\n reactionResources: ReactionResources;\n localParticipant: VideoGalleryLocalParticipant;\n remoteParticipants: VideoGalleryRemoteParticipant[];\n togetherModeSeatPositions: VideoGalleryTogetherModeParticipantPosition;\n }) => {\n const locale = useLocale();\n const theme = useTheme();\n const callingPalette = (theme as unknown as CallingTheme).callingPalette;\n\n const { emojiSize, reactionResources, remoteParticipants, localParticipant, togetherModeSeatPositions } = props;\n const [togetherModeParticipantStatus, setTogetherModeParticipantStatus] = useState<{\n [key: string]: TogetherModeParticipantStatus;\n }>({});\n const [hoveredParticipantID, setHoveredParticipantID] = useState('');\n\n /*\n * The useMemo hook is used to calculate the participant status for the Together Mode overlay.\n * It updates the togetherModeParticipantStatus state when there's a change in the remoteParticipants, localParticipant,\n * raisedHand, spotlight, isMuted, displayName, or hoveredParticipantID.\n */\n useMemo(() => {\n const allParticipants = [...remoteParticipants, localParticipant];\n\n const participantsWithVideoAvailable = allParticipants.filter(\n (p) => p.videoStream?.isAvailable && togetherModeSeatPositions[p.userId]\n );\n\n const updatedSignals: { [key: string]: TogetherModeParticipantStatus } = {};\n for (const p of participantsWithVideoAvailable) {\n const { userId, reaction, raisedHand, spotlight, isMuted, displayName } = p;\n const seatingPosition = togetherModeSeatPositions[userId];\n if (seatingPosition) {\n updatedSignals[userId] = {\n id: userId,\n reaction: reactionResources && reaction,\n isHandRaised: !!raisedHand,\n isSpotlighted: !!spotlight,\n isMuted,\n displayName: displayName || locale.strings.videoGallery.displayNamePlaceholder,\n showDisplayName: !!(spotlight || raisedHand || hoveredParticipantID === userId),\n scaledSize: calculateScaledSize(seatingPosition.width, seatingPosition.height),\n seatPositionStyle: setTogetherModeSeatPositionStyle(seatingPosition)\n };\n }\n }\n\n // This is used to remove the participants bounding box from the DOM when they are no longer in the stream\n const participantsNotInTogetherModeStream = Object.keys(togetherModeParticipantStatus).filter(\n (id) => !updatedSignals[id]\n );\n\n setTogetherModeParticipantStatus((prevSignals) => {\n const newSignals = { ...prevSignals, ...updatedSignals };\n const newSignalsLength = Object.keys(newSignals).length;\n\n participantsNotInTogetherModeStream.forEach((id) => {\n delete newSignals[id];\n });\n\n const hasChanges = Object.keys(newSignals).some(\n (key) =>\n JSON.stringify(newSignals[key]) !== JSON.stringify(prevSignals[key]) ||\n newSignalsLength !== Object.keys(prevSignals).length\n );\n\n return hasChanges ? newSignals : prevSignals;\n });\n }, [\n remoteParticipants,\n localParticipant,\n togetherModeParticipantStatus,\n togetherModeSeatPositions,\n reactionResources,\n locale.strings.videoGallery.displayNamePlaceholder,\n hoveredParticipantID\n ]);\n\n /*\n * When a larger participant scene switches to a smaller group in Together Mode,\n * participant video streams remain available because their video is still active,\n * even though they are not visible in the Together Mode stream.\n * Therefore, we rely on the updated seating position values to identify who is included in the Together Mode stream.\n * The Together mode seat position will only contain seat coordinates of participants who are visible in the Together Mode stream.\n */\n useMemo(() => {\n const removedVisibleParticipants = Object.keys(togetherModeParticipantStatus).filter(\n (participantId) => !togetherModeSeatPositions[participantId]\n );\n\n setTogetherModeParticipantStatus((prevSignals) => {\n const newSignals = { ...prevSignals };\n removedVisibleParticipants.forEach((participantId) => {\n delete newSignals[participantId];\n });\n\n // Trigger a re-render only if changes occurred\n const hasChanges = Object.keys(newSignals).length !== Object.keys(prevSignals).length;\n return hasChanges ? newSignals : prevSignals;\n });\n }, [togetherModeParticipantStatus, togetherModeSeatPositions]);\n\n return (\n <div style={{ position: 'absolute', width: '100%', height: '100%' }}>\n {Object.values(togetherModeParticipantStatus).map(\n (participantStatus) =>\n participantStatus.id && (\n <div\n key={participantStatus.id}\n style={{\n ...getTogetherModeParticipantOverlayStyle(participantStatus.seatPositionStyle)\n }}\n onMouseEnter={() => setHoveredParticipantID(participantStatus.id)}\n onMouseLeave={() => setHoveredParticipantID('')}\n >\n <div>\n {participantStatus.reaction?.reactionType && (\n // First div - Section that fixes the travel height and applies the movement animation\n // Second div - Responsible for ensuring the sprite emoji is always centered in the participant seat position\n // Third div - Play Animation as the other animation applies on the base play animation for the sprite\n <div\n style={moveAnimationStyles(\n parseFloat(participantStatus.seatPositionStyle.seatPosition.height) *\n REACTION_MAX_TRAVEL_HEIGHT,\n parseFloat(participantStatus.seatPositionStyle.seatPosition.height) * REACTION_TRAVEL_HEIGHT\n )}\n >\n <div\n style={{\n ...togetherModeParticipantEmojiSpriteStyle(\n emojiSize,\n participantStatus.scaledSize || 1,\n participantStatus.seatPositionStyle.seatPosition.width\n )\n }}\n >\n <div\n style={spriteAnimationStyles(\n REACTION_NUMBER_OF_ANIMATION_FRAMES,\n participantStatus.scaledSize || 1,\n (participantStatus.reaction &&\n getEmojiResource(participantStatus?.reaction.reactionType, reactionResources)) ??\n ''\n )}\n />\n </div>\n </div>\n )}\n\n {participantStatus.showDisplayName && (\n <div>\n <div\n style={{\n ...togetherModeParticipantStatusContainer(\n callingPalette.videoTileLabelBackgroundLight,\n theme.effects.roundedCorner4\n )\n }}\n >\n {participantStatus.isHandRaised && <RaisedHandIcon />}\n {participantStatus.showDisplayName && (\n <Text\n style={{\n ...togetherModeParticipantDisplayName(\n hoveredParticipantID === participantStatus.id,\n parseFloat(participantStatus.seatPositionStyle.seatPosition.width),\n participantStatus.displayName ? theme.palette.neutralSecondary : 'inherit'\n )\n }}\n >\n {participantStatus.displayName}\n </Text>\n )}\n {participantStatus.isMuted && (\n <Stack className={mergeStyles(togetherModeIconStyle)}>\n <Icon iconName=\"VideoTileMicOff\" />\n </Stack>\n )}\n {participantStatus.isSpotlighted && (\n <Stack className={mergeStyles(togetherModeIconStyle)}>\n <Icon iconName=\"VideoTileSpotlighted\" />\n </Stack>\n )}\n </div>\n </div>\n )}\n </div>\n </div>\n )\n )}\n </div>\n );\n }\n);\n"]}
|
1
|
+
{"version":3,"file":"TogetherModeOverlay.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/TogetherModeOverlay.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,gDAAgD;AAChD,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASlE,gDAAgD;AAChD,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5F,gDAAgD;AAChD,OAAO,EAAE,mCAAmC,EAAE,MAAM,oCAAoC,CAAC;AACzF,gDAAgD;AAChD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACjE,gDAAgD;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,gDAAgD;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,gDAAgD;AAChD,OAAO,EACL,mBAAmB,EACnB,sCAAsC,EACtC,gCAAgC,EAChC,0BAA0B,EAC1B,sBAAsB,EACtB,gCAAgC,EAChC,qBAAqB,EACrB,kCAAkC,EAClC,uCAAuC,EACvC,sCAAsC,EAEvC,MAAM,8BAA8B,CAAC;AACtC,gDAAgD;AAChD,OAAO,EAAgB,QAAQ,EAAE,MAAM,YAAY,CAAC;AACpD,gDAAgD;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAqBzD,gDAAgD;AAChD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,G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AQ,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC,mCAC9E,EAAE,CACL,GACD,CACE,CACF,CACP,CACG,CACF,CACP,CAAA;KAAA,CACJ,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(together-mode) */\nimport React, { useMemo, useState, memo, useEffect } from 'react';\n/* @conditional-compile-remove(together-mode) */\nimport {\n Reaction,\n ReactionResources,\n VideoGalleryTogetherModeParticipantPosition,\n VideoGalleryLocalParticipant,\n VideoGalleryRemoteParticipant\n} from '../types';\n/* @conditional-compile-remove(together-mode) */\nimport { moveAnimationStyles, spriteAnimationStyles } from './styles/ReactionOverlay.style';\n/* @conditional-compile-remove(together-mode) */\nimport { REACTION_NUMBER_OF_ANIMATION_FRAMES } from './VideoGallery/utils/reactionUtils';\n/* @conditional-compile-remove(together-mode) */\nimport { Icon, mergeStyles, Stack, Text } from '@fluentui/react';\n/* @conditional-compile-remove(together-mode) */\nimport { getEmojiResource } from './VideoGallery/utils/videoGalleryLayoutUtils';\n/* @conditional-compile-remove(together-mode) */\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(together-mode) */\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\n/* @conditional-compile-remove(together-mode) */\nimport {\n calculateScaledSize,\n getTogetherModeParticipantOverlayStyle,\n participantStatusTransitionStyle,\n REACTION_MAX_TRAVEL_HEIGHT,\n REACTION_TRAVEL_HEIGHT,\n setTogetherModeSeatPositionStyle,\n togetherModeIconStyle,\n togetherModeParticipantDisplayName,\n togetherModeParticipantEmojiSpriteStyle,\n togetherModeParticipantStatusContainer,\n TogetherModeSeatStyle\n} from './styles/TogetherMode.styles';\n/* @conditional-compile-remove(together-mode) */\nimport { CallingTheme, useTheme } from '../theming';\n/* @conditional-compile-remove(together-mode) */\nimport { RaisedHandIcon } from './assets/RaisedHandIcon';\n/* @conditional-compile-remove(together-mode) */\nimport { _pxToRem } from '@internal/acs-ui-common';\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * Signaling action overlay component props\n * @internal\n */\ntype TogetherModeParticipantStatus = {\n reaction?: Reaction;\n scaledSize?: number;\n isHandRaised?: boolean;\n isSpotlighted?: boolean;\n isMuted?: boolean;\n id: string;\n seatPositionStyle: TogetherModeSeatStyle;\n displayName: string;\n showDisplayName: boolean;\n};\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * TogetherModeOverlay component renders an empty JSX element.\n *\n * @returns {JSX.Element} An empty JSX element.\n */\nexport const TogetherModeOverlay = memo(\n (props: {\n emojiSize: number;\n reactionResources: ReactionResources;\n localParticipant: VideoGalleryLocalParticipant;\n remoteParticipants: VideoGalleryRemoteParticipant[];\n togetherModeSeatPositions: VideoGalleryTogetherModeParticipantPosition;\n }) => {\n const locale = useLocale();\n const theme = useTheme();\n const callingPalette = (theme as unknown as CallingTheme).callingPalette;\n\n const { emojiSize, reactionResources, remoteParticipants, localParticipant, togetherModeSeatPositions } = props;\n const [togetherModeParticipantStatus, setTogetherModeParticipantStatus] = useState<{\n [key: string]: TogetherModeParticipantStatus;\n }>({});\n const [hoveredParticipantID, setHoveredParticipantID] = useState('');\n\n /*\n * The useMemo hook is used to calculate the participant status for the Together Mode overlay.\n * It updates the togetherModeParticipantStatus state when there's a change in the remoteParticipants, localParticipant,\n * raisedHand, spotlight, isMuted, displayName, or hoveredParticipantID.\n */\n const updatedParticipantStatus = useMemo(() => {\n const allParticipants = [...remoteParticipants, localParticipant];\n\n const participantsWithVideoAvailable = allParticipants.filter(\n (p) => p.videoStream?.isAvailable && togetherModeSeatPositions[p.userId]\n );\n\n const updatedSignals: { [key: string]: TogetherModeParticipantStatus } = {};\n for (const p of participantsWithVideoAvailable) {\n const { userId, reaction, raisedHand, spotlight, isMuted, displayName } = p;\n const seatingPosition = togetherModeSeatPositions[userId];\n if (seatingPosition) {\n updatedSignals[userId] = {\n id: userId,\n reaction: reactionResources && reaction,\n isHandRaised: !!raisedHand,\n isSpotlighted: !!spotlight,\n isMuted,\n displayName: displayName || locale.strings.videoGallery.displayNamePlaceholder,\n showDisplayName: !!(spotlight || raisedHand || hoveredParticipantID === userId),\n scaledSize: calculateScaledSize(seatingPosition.width, seatingPosition.height),\n seatPositionStyle: setTogetherModeSeatPositionStyle(seatingPosition)\n };\n }\n }\n\n // This is used to remove the participants bounding box from the DOM when they are no longer in the stream\n const participantsNotInTogetherModeStream = Object.keys(togetherModeParticipantStatus).filter(\n (id) => !updatedSignals[id]\n );\n\n const newSignals = { ...togetherModeParticipantStatus, ...updatedSignals };\n\n participantsNotInTogetherModeStream.forEach((id) => {\n delete newSignals[id];\n });\n\n const hasSignalingChange = Object.keys(newSignals).some(\n (key) => JSON.stringify(newSignals[key]) !== JSON.stringify(togetherModeParticipantStatus[key])\n );\n\n const updateTogetherModeParticipantStatusState =\n hasSignalingChange || Object.keys(newSignals).length !== Object.keys(togetherModeParticipantStatus).length;\n return updateTogetherModeParticipantStatusState ? newSignals : togetherModeParticipantStatus;\n }, [\n remoteParticipants,\n localParticipant,\n togetherModeParticipantStatus,\n togetherModeSeatPositions,\n reactionResources,\n locale.strings.videoGallery.displayNamePlaceholder,\n hoveredParticipantID\n ]);\n\n useEffect(() => {\n if (hoveredParticipantID && !updatedParticipantStatus[hoveredParticipantID]) {\n setHoveredParticipantID('');\n }\n\n setTogetherModeParticipantStatus(updatedParticipantStatus);\n }, [hoveredParticipantID, updatedParticipantStatus]);\n\n return (\n <div style={{ position: 'absolute', width: '100%', height: '100%' }}>\n {Object.values(togetherModeParticipantStatus).map(\n (participantStatus) =>\n participantStatus.id && (\n <div\n key={participantStatus.id}\n style={{\n ...getTogetherModeParticipantOverlayStyle(participantStatus.seatPositionStyle)\n }}\n onMouseEnter={() => setHoveredParticipantID(participantStatus.id)}\n onMouseLeave={() => setHoveredParticipantID('')}\n >\n <div>\n {participantStatus.showDisplayName && (\n <div style={{ ...participantStatusTransitionStyle }}>\n <div\n style={{\n ...togetherModeParticipantStatusContainer(\n callingPalette.videoTileLabelBackgroundLight,\n theme.effects.roundedCorner4\n )\n }}\n >\n {participantStatus.isHandRaised && <RaisedHandIcon />}\n {participantStatus.showDisplayName && (\n <Text\n style={{\n ...togetherModeParticipantDisplayName(\n hoveredParticipantID === participantStatus.id,\n parseFloat(participantStatus.seatPositionStyle.seatPosition.width),\n participantStatus.displayName ? theme.palette.neutralSecondary : 'inherit'\n )\n }}\n >\n {participantStatus.displayName}\n </Text>\n )}\n {participantStatus.isMuted && (\n <Stack className={mergeStyles(togetherModeIconStyle)}>\n <Icon iconName=\"VideoTileMicOff\" />\n </Stack>\n )}\n {participantStatus.isSpotlighted && (\n <Stack className={mergeStyles(togetherModeIconStyle)}>\n <Icon iconName=\"VideoTileSpotlighted\" />\n </Stack>\n )}\n </div>\n </div>\n )}\n\n {participantStatus.reaction?.reactionType && (\n // First div - Section that fixes the travel height and applies the movement animation\n // Second div - Responsible for ensuring the sprite emoji is always centered in the participant seat position\n // Third div - Play Animation as the other animation applies on the base play animation for the sprite\n <div\n style={moveAnimationStyles(\n parseFloat(participantStatus.seatPositionStyle.seatPosition.height) *\n REACTION_MAX_TRAVEL_HEIGHT,\n parseFloat(participantStatus.seatPositionStyle.seatPosition.height) * REACTION_TRAVEL_HEIGHT\n )}\n >\n <div\n style={{\n ...togetherModeParticipantEmojiSpriteStyle(\n emojiSize,\n participantStatus.scaledSize || 1,\n participantStatus.seatPositionStyle.seatPosition.width\n )\n }}\n >\n <div\n style={spriteAnimationStyles(\n REACTION_NUMBER_OF_ANIMATION_FRAMES,\n participantStatus.scaledSize || 1,\n (participantStatus.reaction &&\n getEmojiResource(participantStatus?.reaction.reactionType, reactionResources)) ??\n ''\n )}\n />\n </div>\n </div>\n )}\n </div>\n </div>\n )\n )}\n </div>\n );\n }\n);\n"]}
|
@@ -29,8 +29,6 @@ export const LocalScreenShare = React.memo((props) => {
|
|
29
29
|
? locale.strings.videoGallery.displayNamePlaceholder
|
30
30
|
: localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.displayName;
|
31
31
|
const loadingMessage = locale.strings.videoGallery.localScreenShareLoadingMessage;
|
32
|
-
return (React.createElement(VideoTile, { displayName: displayName, isMuted: localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.isMuted, renderElement: renderElement ? (React.createElement(StreamMedia, { videoStreamElement: renderElement, loadingState: isAvailable === false ? 'loading' : 'none' })) : undefined, onRenderPlaceholder: () => React.createElement(LoadingSpinner, { loadingMessage: loadingMessage }),
|
33
|
-
/* @conditional-compile-remove(media-access) */
|
34
|
-
mediaAccess: localParticipant.mediaAccess }));
|
32
|
+
return (React.createElement(VideoTile, { displayName: displayName, isMuted: localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.isMuted, renderElement: renderElement ? (React.createElement(StreamMedia, { videoStreamElement: renderElement, loadingState: isAvailable === false ? 'loading' : 'none' })) : undefined, onRenderPlaceholder: () => React.createElement(LoadingSpinner, { loadingMessage: loadingMessage }), mediaAccess: localParticipant.mediaAccess }));
|
35
33
|
});
|
36
34
|
//# sourceMappingURL=LocalScreenShare.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LocalScreenShare.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/LocalScreenShare.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CACxC,CAAC,KAMA,EAAE,EAAE;IACH,MAAM,EACJ,gBAAgB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file":"LocalScreenShare.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/LocalScreenShare.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CACxC,CAAC,KAMA,EAAE,EAAE;IACH,MAAM,EACJ,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,uBAAuB,EACvB,mCAAmC,EACpC,GAAG,KAAK,CAAC;IACV,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;IACvD,CAAC;IAED,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE;YACV,oEAAoE;YACpE,mCAAmC,IAAI,mCAAmC,EAAE,CAAC;QAC/E,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,mCAAmC,CAAC,CAAC,CAAC;IAE1C,IAAI,CAAC,gBAAgB,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,WAAW,GAAG,CAAC,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,WAAW,CAAA;QAChD,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,sBAAsB;QACpD,CAAC,CAAC,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,WAAW,CAAC;IAElC,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,8BAA8B,CAAC;IAElF,OAAO,CACL,oBAAC,SAAS,IACR,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,EAClC,aAAa,EACX,aAAa,CAAC,CAAC,CAAC,CACd,oBAAC,WAAW,IAAC,kBAAkB,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,GAAI,CAC7G,CAAC,CAAC,CAAC,SAAS,EAEf,mBAAmB,EAAE,GAAG,EAAE,CAAC,oBAAC,cAAc,IAAC,cAAc,EAAE,cAAc,GAAI,EAC7E,WAAW,EAAE,gBAAgB,CAAC,WAAW,GACzC,CACH,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useEffect } from 'react';\nimport { useLocale } from '../../localization';\nimport { CreateVideoStreamViewResult, VideoGalleryLocalParticipant, VideoStreamOptions } from '../../types';\nimport { VideoTile } from '../VideoTile';\nimport { StreamMedia } from '../StreamMedia';\nimport { LoadingSpinner } from './RemoteScreenShare';\nimport { _formatString } from '@internal/acs-ui-common';\n\n/**\n * A memoized version of local screen share component. React.memo is used for a performance\n * boost by memoizing the same rendered component to avoid rerendering this when the parent component rerenders.\n * https://reactjs.org/docs/react-api.html#reactmemo\n */\nexport const LocalScreenShare = React.memo(\n (props: {\n localParticipant: VideoGalleryLocalParticipant;\n renderElement?: HTMLElement;\n isAvailable?: boolean;\n onCreateLocalStreamView?: (options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeLocalScreenShareStreamView?: () => Promise<void>;\n }) => {\n const {\n localParticipant,\n renderElement,\n isAvailable,\n onCreateLocalStreamView,\n onDisposeLocalScreenShareStreamView\n } = props;\n const locale = useLocale();\n if (!renderElement) {\n onCreateLocalStreamView && onCreateLocalStreamView();\n }\n\n useEffect(() => {\n return () => {\n // TODO: Isolate disposing behaviors for screenShare and videoStream\n onDisposeLocalScreenShareStreamView && onDisposeLocalScreenShareStreamView();\n };\n }, [onDisposeLocalScreenShareStreamView]);\n\n if (!localParticipant || !localParticipant.isScreenSharingOn) {\n return null;\n }\n\n const displayName = !localParticipant?.displayName\n ? locale.strings.videoGallery.displayNamePlaceholder\n : localParticipant?.displayName;\n\n const loadingMessage = locale.strings.videoGallery.localScreenShareLoadingMessage;\n\n return (\n <VideoTile\n displayName={displayName}\n isMuted={localParticipant?.isMuted}\n renderElement={\n renderElement ? (\n <StreamMedia videoStreamElement={renderElement} loadingState={isAvailable === false ? 'loading' : 'none'} />\n ) : undefined\n }\n onRenderPlaceholder={() => <LoadingSpinner loadingMessage={loadingMessage} />}\n mediaAccess={localParticipant.mediaAccess}\n />\n );\n }\n);\n"]}
|
@@ -1,9 +1,10 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { LayoutProps } from './Layout';
|
3
2
|
/**
|
4
3
|
* A memoized version of local screen share component. React.memo is used for a performance
|
5
4
|
* boost by memoizing the same rendered component to avoid rerendering this when the parent component rerenders.
|
6
5
|
* https://reactjs.org/docs/react-api.html#reactmemo
|
7
6
|
*/
|
8
|
-
export declare const TogetherModeLayout: (props:
|
7
|
+
export declare const TogetherModeLayout: (props: {
|
8
|
+
togetherModeStreamComponent: JSX.Element;
|
9
|
+
}) => JSX.Element;
|
9
10
|
//# sourceMappingURL=TogetherModeLayout.d.ts.map
|