@azure/communication-react 1.4.2-alpha-202211260013.0 → 1.4.2-alpha-202211290015.0
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/CHANGELOG.beta.md +47 -1
- package/CHANGELOG.json +507 -0
- package/dist/communication-react.d.ts +44 -0
- package/dist/dist-cjs/communication-react/index.js +138 -14
- package/dist/dist-cjs/communication-react/index.js.map +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/react-composites/src/composites/CallComposite/Strings.d.ts +44 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +6 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/mediaGallerySelector.d.ts +7 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/mediaGallerySelector.js +9 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/mediaGallerySelector.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.d.ts +29 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js +119 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +12 -1
- package/package.json +8 -8
@@ -202,7 +202,7 @@ const _toCommunicationIdentifier = (id) => {
|
|
202
202
|
// Copyright (c) Microsoft Corporation.
|
203
203
|
// Licensed under the MIT license.
|
204
204
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
205
|
-
var telemetryVersion = '1.4.2-alpha-
|
205
|
+
var telemetryVersion = '1.4.2-alpha-202211290015.0';
|
206
206
|
|
207
207
|
// Copyright (c) Microsoft Corporation.
|
208
208
|
/**
|
@@ -13996,7 +13996,7 @@ const CallCompositeIcon = (props) => (React__default['default'].createElement(re
|
|
13996
13996
|
*/
|
13997
13997
|
const CallWithChatCompositeIcon = (props) => (React__default['default'].createElement(react.FontIcon, Object.assign({}, props)));
|
13998
13998
|
|
13999
|
-
var call$d={cameraLabel:"Camera",cameraPermissionDenied:"Your browser is blocking access to your camera",cameraTurnedOff:"Your camera is turned off",chatButtonLabel:"Chat",close:"Close",complianceBannerNowOnlyRecording:"You are now only recording this meeting.",complianceBannerNowOnlyTranscription:"You are now only transcribing this meeting.",complianceBannerRecordingAndTranscriptionSaved:"Recording and transcription are being saved.",complianceBannerRecordingAndTranscriptionStarted:"Recording and transcription have started.",complianceBannerRecordingAndTranscriptionStopped:"Recording and transcription have stopped.",complianceBannerRecordingSaving:"Recording is being saved.",complianceBannerRecordingStarted:"Recording has started.",complianceBannerRecordingStopped:"Recording has stopped.",complianceBannerTranscriptionStarted:"Transcription has started.",complianceBannerTranscriptionConsent:"By joining, you are giving consent for this meeting to be transcribed.",complianceBannerTranscriptionSaving:"Transcription is being saved.",complianceBannerTranscriptionStopped:"Transcription has stopped.",configurationPageTitle:"Start a call",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",defaultPlaceHolder:"Select an option",dismissSidePaneButtonLabel:"Close",failedToJoinCallDueToNoNetworkMoreDetails:"Call was disconnected due to a network issue. Check your connection and join again.",failedToJoinCallDueToNoNetworkTitle:"Call disconnected",failedToJoinTeamsMeetingReasonAccessDeniedMoreDetails:"You were not granted entry in the call. If this was a mistake, re-join the call.",failedToJoinTeamsMeetingReasonAccessDeniedTitle:"Dismissed from lobby",learnMore:"Learn more",leftCallMoreDetails:"If this was a mistake, re-join the call.",leftCallTitle:"You left the call",lobbyScreenConnectingToCallTitle:"Joining call",lobbyScreenWaitingToBeAdmittedTitle:"Waiting to be admitted",microphonePermissionDenied:"Your browser is blocking access to your microphone",microphoneToggleInLobbyNotAllowed:"Cannot mute or unmute while in lobby.",mutedMessage:"You're muted",networkReconnectMoreDetails:"Looks like something went wrong. We're trying to get back into the call.",networkReconnectTitle:"Hold on",deniedPermissionToRoomDetails:"You do not have permission to join this room.",deniedPermissionToRoomTitle:"Permission denied to room",peopleButtonLabel:"People",peoplePaneTitle:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",privacyPolicy:"Privacy policy",rejoinCallButtonLabel:"Re-join call",removedFromCallMoreDetails:"Another participant removed you from the call.",removedFromCallTitle:"You were removed",removeMenuLabel:"Remove",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",roomNotFoundDetails:"Room ID provided is not valid.",roomNotFoundTitle:"Room not found",soundLabel:"Sound",startCallButtonLabel:"Start call",openDialpadButtonLabel:"Dial phone number",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",moreButtonCallingLabel:"More",resumeCallButtonLabel:"Resume",resumingCallButtonLabel:"Resuming...",resumeCallButtonAriaLabel:"Resume call",resumingCallButtonAriaLabel:"Resume call",holdScreenLabel:"You're on hold",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceholderText:"Enter number",outboundCallingNoticeString:"Calling..."};var chat$d={chatListHeader:"In this chat",uploadFile:"Upload File"};var callWithChat$d={chatButtonLabel:"Chat",chatButtonNewMessageNotificationLabel:"New Message",chatButtonTooltipClosedWithMessageCount:"Show chat ({unreadMessagesCount} unread)",chatButtonTooltipClose:"Hide chat",chatButtonTooltipOpen:"Show chat",chatPaneTitle:"Chat",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",dismissSidePaneButtonLabel:"Close",moreDrawerAudioDeviceMenuTitle:"Audio Device",moreDrawerButtonLabel:"More options",moreDrawerButtonTooltip:"More options",moreDrawerMicrophoneMenuTitle:"Microphone",moreDrawerSpeakerMenuTitle:"Speaker",peopleButtonLabel:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",peoplePaneTitle:"People",pictureInPictureTileAriaLabel:"Video Feeds. Click to return to call screen.",removeMenuLabel:"Remove",openDialpadButtonLabel:"Dial phone number",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceholderText:"Enter number"};var en_US = {call:call$d,chat:chat$d,callWithChat:callWithChat$d};
|
13999
|
+
var call$d={cameraLabel:"Camera",cameraPermissionDenied:"Your browser is blocking access to your camera",cameraTurnedOff:"Your camera is turned off",chatButtonLabel:"Chat",close:"Close",complianceBannerNowOnlyRecording:"You are now only recording this meeting.",complianceBannerNowOnlyTranscription:"You are now only transcribing this meeting.",complianceBannerRecordingAndTranscriptionSaved:"Recording and transcription are being saved.",complianceBannerRecordingAndTranscriptionStarted:"Recording and transcription have started.",complianceBannerRecordingAndTranscriptionStopped:"Recording and transcription have stopped.",complianceBannerRecordingSaving:"Recording is being saved.",complianceBannerRecordingStarted:"Recording has started.",complianceBannerRecordingStopped:"Recording has stopped.",complianceBannerTranscriptionStarted:"Transcription has started.",complianceBannerTranscriptionConsent:"By joining, you are giving consent for this meeting to be transcribed.",complianceBannerTranscriptionSaving:"Transcription is being saved.",complianceBannerTranscriptionStopped:"Transcription has stopped.",configurationPageTitle:"Start a call",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",defaultPlaceHolder:"Select an option",dismissSidePaneButtonLabel:"Close",failedToJoinCallDueToNoNetworkMoreDetails:"Call was disconnected due to a network issue. Check your connection and join again.",failedToJoinCallDueToNoNetworkTitle:"Call disconnected",failedToJoinTeamsMeetingReasonAccessDeniedMoreDetails:"You were not granted entry in the call. If this was a mistake, re-join the call.",failedToJoinTeamsMeetingReasonAccessDeniedTitle:"Dismissed from lobby",learnMore:"Learn more",leftCallMoreDetails:"If this was a mistake, re-join the call.",leftCallTitle:"You left the call",lobbyScreenConnectingToCallTitle:"Joining call",lobbyScreenWaitingToBeAdmittedTitle:"Waiting to be admitted",microphonePermissionDenied:"Your browser is blocking access to your microphone",microphoneToggleInLobbyNotAllowed:"Cannot mute or unmute while in lobby.",mutedMessage:"You're muted",networkReconnectMoreDetails:"Looks like something went wrong. We're trying to get back into the call.",networkReconnectTitle:"Hold on",deniedPermissionToRoomDetails:"You do not have permission to join this room.",deniedPermissionToRoomTitle:"Permission denied to room",peopleButtonLabel:"People",peoplePaneTitle:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",privacyPolicy:"Privacy policy",rejoinCallButtonLabel:"Re-join call",removedFromCallMoreDetails:"Another participant removed you from the call.",removedFromCallTitle:"You were removed",removeMenuLabel:"Remove",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",roomNotFoundDetails:"Room ID provided is not valid.",roomNotFoundTitle:"Room not found",soundLabel:"Sound",startCallButtonLabel:"Start call",openDialpadButtonLabel:"Dial phone number",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",moreButtonCallingLabel:"More",resumeCallButtonLabel:"Resume",resumingCallButtonLabel:"Resuming...",resumeCallButtonAriaLabel:"Resume call",resumingCallButtonAriaLabel:"Resume call",holdScreenLabel:"You're on hold",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceholderText:"Enter number",outboundCallingNoticeString:"Calling...",participantJoinedNoticeString:"{displayName} joined",twoParticipantJoinedNoticeString:"{displayName1} and {displayName2} have joined",threeParticipantJoinedNoticeString:"{displayName1}, {displayName2} and {displayName3} have joined",participantLeftNoticeString:"{displayName} left",twoParticipantLeftNoticeString:"{displayName1} and {displayName2} have left",threeParticipantLeftNoticeString:"{displayName1}, {displayName2} and {displayName3} have left",unnamedParticipantString:"unnamed participant",manyUnnamedParticipantsJoined:"unnamed participant and {numOfParticipants} other participants joined",manyUnnamedParticipantsLeft:"unnamed participant and {numOfParticipants} other participants left",manyParticipantsJoined:"{displayName1}, {displayName2}, {displayName3} and {numOfParticipants} other participants joined",manyParticipantsLeft:"{displayName1}, {displayName2}, {displayName3} and {numOfParticipants} other participants left"};var chat$d={chatListHeader:"In this chat",uploadFile:"Upload File"};var callWithChat$d={chatButtonLabel:"Chat",chatButtonNewMessageNotificationLabel:"New Message",chatButtonTooltipClosedWithMessageCount:"Show chat ({unreadMessagesCount} unread)",chatButtonTooltipClose:"Hide chat",chatButtonTooltipOpen:"Show chat",chatPaneTitle:"Chat",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",dismissSidePaneButtonLabel:"Close",moreDrawerAudioDeviceMenuTitle:"Audio Device",moreDrawerButtonLabel:"More options",moreDrawerButtonTooltip:"More options",moreDrawerMicrophoneMenuTitle:"Microphone",moreDrawerSpeakerMenuTitle:"Speaker",peopleButtonLabel:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",peoplePaneTitle:"People",pictureInPictureTileAriaLabel:"Video Feeds. Click to return to call screen.",removeMenuLabel:"Remove",openDialpadButtonLabel:"Dial phone number",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceholderText:"Enter number"};var en_US = {call:call$d,chat:chat$d,callWithChat:callWithChat$d};
|
14000
14000
|
|
14001
14001
|
var call$c={cameraLabel:"Camera",cameraPermissionDenied:"Your browser is blocking access to your camera",cameraTurnedOff:"Your camera is turned off",chatButtonLabel:"Chat",close:"Close",complianceBannerNowOnlyRecording:"You are now only recording this meeting.",complianceBannerNowOnlyTranscription:"You are now only transcribing this meeting.",complianceBannerRecordingAndTranscriptionSaved:"Recording and transcription are being saved.",complianceBannerRecordingAndTranscriptionStarted:"Recording and transcription have started.",complianceBannerRecordingAndTranscriptionStopped:"Recording and transcription have stopped.",complianceBannerRecordingSaving:"Recording is being saved.",complianceBannerRecordingStarted:"Recording has started.",complianceBannerRecordingStopped:"Recording has stopped.",complianceBannerTranscriptionStarted:"Transcription has started.",complianceBannerTranscriptionConsent:"By joining, you are giving consent for this meeting to be transcribed.",complianceBannerTranscriptionSaving:"Transcription is being saved.",complianceBannerTranscriptionStopped:"Transcription has stopped.",configurationPageTitle:"Start a call",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",defaultPlaceHolder:"Select an option",dismissSidePaneButtonLabel:"Close",failedToJoinCallDueToNoNetworkMoreDetails:"Call was disconnected due to a network issue. Check your connection and join again.",failedToJoinCallDueToNoNetworkTitle:"Call disconnected",failedToJoinTeamsMeetingReasonAccessDeniedMoreDetails:"You were not granted entry in the call. If this was a mistake, re-join the call.",failedToJoinTeamsMeetingReasonAccessDeniedTitle:"Dismissed from lobby",learnMore:"Learn more",leftCallMoreDetails:"If this was a mistake, re-join the call.",leftCallTitle:"You left the call",lobbyScreenConnectingToCallTitle:"Joining call",lobbyScreenWaitingToBeAdmittedTitle:"Waiting to be admitted",microphonePermissionDenied:"Your browser is blocking access to your microphone",microphoneToggleInLobbyNotAllowed:"Cannot mute or unmute while in lobby.",mutedMessage:"You're muted",networkReconnectMoreDetails:"Looks like something went wrong. We're trying to get back into the call.",networkReconnectTitle:"Hold on",deniedPermissionToRoomDetails:"You do not have permission to join this room.",deniedPermissionToRoomTitle:"Permission denied to room",peopleButtonLabel:"People",peoplePaneTitle:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",privacyPolicy:"Privacy policy",rejoinCallButtonLabel:"Re-join call",removedFromCallMoreDetails:"Another participant removed you from the call.",removedFromCallTitle:"You were removed",removeMenuLabel:"Remove",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",roomNotFoundDetails:"Room ID provided is not valid.",roomNotFoundTitle:"Room not found",soundLabel:"Sound",startCallButtonLabel:"Start call",openDialpadButtonLabel:"Dial phone number",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",moreButtonCallingLabel:"More",resumeCallButtonLabel:"Resume",resumingCallButtonLabel:"Resuming...",resumeCallButtonAriaLabel:"Resume call",resumingCallButtonAriaLabel:"Resume call",holdScreenLabel:"You're on hold",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceHolderText:"Enter number",outboundCallingNoticeString:"Calling..."};var chat$c={chatListHeader:"In this chat",uploadFile:"Upload File"};var callWithChat$c={chatButtonLabel:"Chat",chatButtonNewMessageNotificationLabel:"New Message",chatButtonTooltipClosedWithMessageCount:"Show chat ({unreadMessagesCount} unread)",chatButtonTooltipClose:"Hide chat",chatButtonTooltipOpen:"Show chat",chatPaneTitle:"Chat",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",dismissSidePaneButtonLabel:"Close",moreDrawerAudioDeviceMenuTitle:"Audio Device",moreDrawerButtonLabel:"More options",moreDrawerButtonTooltip:"More options",moreDrawerMicrophoneMenuTitle:"Microphone",moreDrawerSpeakerMenuTitle:"Speaker",peopleButtonLabel:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",peoplePaneTitle:"People",pictureInPictureTileAriaLabel:"Video Feeds. Click to return to call screen.",removeMenuLabel:"Remove",openDialpadButtonLabel:"Dial phone number",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceHolderText:"Enter number"};var en_GB = {call:call$c,chat:chat$c,callWithChat:callWithChat$c};
|
14002
14002
|
|
@@ -17765,6 +17765,138 @@ const localVideoCameraCycleButtonSelector = reselect.createSelector([getDeviceMa
|
|
17765
17765
|
};
|
17766
17766
|
});
|
17767
17767
|
|
17768
|
+
// Copyright (c) Microsoft Corporation.
|
17769
|
+
/**
|
17770
|
+
* @private
|
17771
|
+
*/
|
17772
|
+
const mediaGallerySelector = reselect__namespace.createSelector([getLocalVideoStreams], (localVideoStreams) => {
|
17773
|
+
var _a, _b;
|
17774
|
+
return {
|
17775
|
+
isVideoStreamOn: !!((_b = (_a = localVideoStreams === null || localVideoStreams === void 0 ? void 0 : localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) === null || _a === void 0 ? void 0 : _a.view) === null || _b === void 0 ? void 0 : _b.target)
|
17776
|
+
};
|
17777
|
+
});
|
17778
|
+
/**
|
17779
|
+
* Custom selector for this hook to retrieve all the participants that are currently
|
17780
|
+
* connected to the call.
|
17781
|
+
*/
|
17782
|
+
const getRemoteParticipantsConnectedSelector = reselect__namespace.createSelector([getRemoteParticipants], (remoteParticipants) => {
|
17783
|
+
const participants = Object.values(remoteParticipants !== null && remoteParticipants !== void 0 ? remoteParticipants : {});
|
17784
|
+
return participants.filter((p) => p.state === 'Connected');
|
17785
|
+
});
|
17786
|
+
|
17787
|
+
// Copyright (c) Microsoft Corporation.
|
17788
|
+
/**
|
17789
|
+
* sets the announcement string whenever a Participant comes or goes from a call to be
|
17790
|
+
* used by the system narrator.
|
17791
|
+
*
|
17792
|
+
* @returns string to be used by the narrator and Announcer component
|
17793
|
+
*
|
17794
|
+
* @internal
|
17795
|
+
*/
|
17796
|
+
const useParticipantChangedAnnouncement = () => {
|
17797
|
+
const locale = useLocale().strings.call;
|
17798
|
+
const strings = React.useMemo(() => {
|
17799
|
+
return {
|
17800
|
+
participantJoinedNoticeString: locale.participantJoinedNoticeString,
|
17801
|
+
twoParticipantJoinedNoticeString: locale.twoParticipantJoinedNoticeString,
|
17802
|
+
threeParticipantJoinedNoticeString: locale.threeParticipantJoinedNoticeString,
|
17803
|
+
participantLeftNoticeString: locale.participantLeftNoticeString,
|
17804
|
+
twoParticipantLeftNoticeString: locale.twoParticipantLeftNoticeString,
|
17805
|
+
threeParticipantLeftNoticeString: locale.threeParticipantLeftNoticeString,
|
17806
|
+
unnamedParticipantString: locale.unnamedParticipantString,
|
17807
|
+
manyParticipantsJoined: locale.manyParticipantsJoined,
|
17808
|
+
manyParticipantsLeft: locale.manyParticipantsLeft,
|
17809
|
+
manyUnnamedParticipantsJoined: locale.manyUnnamedParticipantsJoined,
|
17810
|
+
manyUnnamedParticipantsLeft: locale.manyUnnamedParticipantsLeft
|
17811
|
+
};
|
17812
|
+
}, [locale]);
|
17813
|
+
const [announcerString, setAnnouncerString] = React.useState('');
|
17814
|
+
const currentParticipants = useSelector$1(getRemoteParticipantsConnectedSelector);
|
17815
|
+
/**
|
17816
|
+
* We want to use a useRef here since we want to not fire this hook based on the previous participants
|
17817
|
+
* this allows this value to be used in the hook without being in the dependency array.
|
17818
|
+
*
|
17819
|
+
* Note: By definition if this hook is used in another component it is not pure anymore.
|
17820
|
+
*/
|
17821
|
+
const previousParticipants = React.useRef(currentParticipants);
|
17822
|
+
const resetAnnoucement = (string) => {
|
17823
|
+
setAnnouncerString(string);
|
17824
|
+
};
|
17825
|
+
React.useMemo(() => {
|
17826
|
+
const currentIds = currentParticipants.map((p) => toFlatCommunicationIdentifier(p.identifier));
|
17827
|
+
const previousIds = previousParticipants.current.map((p) => toFlatCommunicationIdentifier(p.identifier));
|
17828
|
+
const whoJoined = currentParticipants.filter((p) => !previousIds.includes(toFlatCommunicationIdentifier(p.identifier)));
|
17829
|
+
const whoLeft = previousParticipants.current.filter((p) => !currentIds.includes(toFlatCommunicationIdentifier(p.identifier)));
|
17830
|
+
if (whoJoined.length > 0) {
|
17831
|
+
resetAnnoucement(createAnnouncmentString('joined', whoJoined, strings));
|
17832
|
+
}
|
17833
|
+
if (whoLeft.length > 0) {
|
17834
|
+
resetAnnoucement(createAnnouncmentString('left', whoLeft, strings));
|
17835
|
+
}
|
17836
|
+
// Update cached value at the end.
|
17837
|
+
previousParticipants.current = currentParticipants;
|
17838
|
+
}, [currentParticipants, strings]);
|
17839
|
+
return announcerString;
|
17840
|
+
};
|
17841
|
+
/**
|
17842
|
+
* Generates the announcement string for when a participant joins or leaves a call.
|
17843
|
+
*/
|
17844
|
+
const createAnnouncmentString = (direction, participants, strings) => {
|
17845
|
+
var _a, _b, _c;
|
17846
|
+
/**
|
17847
|
+
* If there are no participants return empty string.
|
17848
|
+
*/
|
17849
|
+
if (participants.length === 0) {
|
17850
|
+
return '';
|
17851
|
+
}
|
17852
|
+
/**
|
17853
|
+
* Filter participants into two arrays to put all the unnamed participants at the back of the
|
17854
|
+
* names being announced.
|
17855
|
+
*/
|
17856
|
+
const unnamedParticipants = participants.filter((p) => p.displayName === undefined);
|
17857
|
+
const namedParicipants = participants.filter((p) => p.displayName);
|
17858
|
+
const sortedParticipants = namedParicipants.concat(unnamedParticipants);
|
17859
|
+
/**
|
17860
|
+
* if there are only unnamed participants present in the array announce a special unnamed participants
|
17861
|
+
* only string.
|
17862
|
+
*/
|
17863
|
+
if (sortedParticipants.filter((p) => p.displayName).length === 0 && sortedParticipants.length > 1) {
|
17864
|
+
return _formatString(direction === 'joined' ? strings.manyUnnamedParticipantsJoined : strings.manyUnnamedParticipantsLeft, {
|
17865
|
+
numOfParticipants: (sortedParticipants.length - 1).toString()
|
17866
|
+
});
|
17867
|
+
}
|
17868
|
+
const participantNames = sortedParticipants.map((p) => { var _a; return (_a = p.displayName) !== null && _a !== void 0 ? _a : strings.unnamedParticipantString; });
|
17869
|
+
switch (sortedParticipants.length) {
|
17870
|
+
case 1:
|
17871
|
+
return _formatString(direction === 'joined' ? strings.participantJoinedNoticeString : strings.participantLeftNoticeString, { displayName: participantNames[0] });
|
17872
|
+
case 2:
|
17873
|
+
return _formatString(direction === 'joined' ? strings.twoParticipantJoinedNoticeString : strings.twoParticipantLeftNoticeString, {
|
17874
|
+
displayName1: participantNames[0],
|
17875
|
+
displayName2: participantNames[1]
|
17876
|
+
});
|
17877
|
+
case 3:
|
17878
|
+
return _formatString(direction === 'joined' ? strings.threeParticipantJoinedNoticeString : strings.threeParticipantLeftNoticeString, {
|
17879
|
+
displayName1: participantNames[0],
|
17880
|
+
displayName2: participantNames[1],
|
17881
|
+
displayName3: participantNames[2]
|
17882
|
+
});
|
17883
|
+
}
|
17884
|
+
/**
|
17885
|
+
* If we have more than 3 participants joining we need to do something more to announce them
|
17886
|
+
* appropriately.
|
17887
|
+
*
|
17888
|
+
* We don't want to announce every name when more than 3 participants join at once so
|
17889
|
+
* we parse out the first 3 names we have and announce those with the number of others.
|
17890
|
+
*/
|
17891
|
+
const numberOfExtraParticipants = sortedParticipants.length - 3;
|
17892
|
+
return _formatString(direction === 'joined' ? strings.manyParticipantsJoined : strings.manyParticipantsLeft, {
|
17893
|
+
displayName1: (_a = sortedParticipants[0].displayName) !== null && _a !== void 0 ? _a : strings.unnamedParticipantString,
|
17894
|
+
displayName2: (_b = sortedParticipants[1].displayName) !== null && _b !== void 0 ? _b : strings.unnamedParticipantString,
|
17895
|
+
displayName3: (_c = sortedParticipants[2].displayName) !== null && _c !== void 0 ? _c : strings.unnamedParticipantString,
|
17896
|
+
numOfParticipants: numberOfExtraParticipants.toString()
|
17897
|
+
});
|
17898
|
+
};
|
17899
|
+
|
17768
17900
|
// Copyright (c) Microsoft Corporation.
|
17769
17901
|
const VideoGalleryStyles = {
|
17770
17902
|
root: {
|
@@ -17787,6 +17919,7 @@ const MediaGallery = (props) => {
|
|
17787
17919
|
const videoGalleryProps = usePropsFor$1(VideoGallery);
|
17788
17920
|
const cameraSwitcherCameras = useSelector$1(localVideoCameraCycleButtonSelector);
|
17789
17921
|
const cameraSwitcherCallback = useHandlers();
|
17922
|
+
const announcerString = useParticipantChangedAnnouncement();
|
17790
17923
|
const cameraSwitcherProps = React.useMemo(() => {
|
17791
17924
|
return Object.assign(Object.assign({}, cameraSwitcherCallback), cameraSwitcherCameras);
|
17792
17925
|
}, [cameraSwitcherCallback, cameraSwitcherCameras]);
|
@@ -17799,7 +17932,9 @@ const MediaGallery = (props) => {
|
|
17799
17932
|
const VideoGalleryMemoized = React.useMemo(() => {
|
17800
17933
|
return (React__default['default'].createElement(VideoGallery, Object.assign({}, videoGalleryProps, { localVideoViewOptions: localVideoViewOptions$2, remoteVideoViewOptions: remoteVideoViewOptions, styles: VideoGalleryStyles, layout: "floatingLocalVideo", showCameraSwitcherInLocalPreview: props.isMobile, localVideoCameraCycleButtonProps: cameraSwitcherProps, onRenderAvatar: onRenderAvatar })));
|
17801
17934
|
}, [videoGalleryProps, props.isMobile, onRenderAvatar, cameraSwitcherProps]);
|
17802
|
-
return
|
17935
|
+
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
17936
|
+
React__default['default'].createElement(Announcer, { announcementString: announcerString, ariaLive: 'polite' }),
|
17937
|
+
VideoGalleryMemoized));
|
17803
17938
|
};
|
17804
17939
|
/**
|
17805
17940
|
* @private
|
@@ -17964,17 +18099,6 @@ const complianceBannerSelector = reselect__namespace.createSelector([getIsTransc
|
|
17964
18099
|
};
|
17965
18100
|
});
|
17966
18101
|
|
17967
|
-
// Copyright (c) Microsoft Corporation.
|
17968
|
-
/**
|
17969
|
-
* @private
|
17970
|
-
*/
|
17971
|
-
const mediaGallerySelector = reselect__namespace.createSelector([getLocalVideoStreams], (localVideoStreams) => {
|
17972
|
-
var _a, _b;
|
17973
|
-
return {
|
17974
|
-
isVideoStreamOn: !!((_b = (_a = localVideoStreams === null || localVideoStreams === void 0 ? void 0 : localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) === null || _a === void 0 ? void 0 : _a.view) === null || _b === void 0 ? void 0 : _b.target)
|
17975
|
-
};
|
17976
|
-
});
|
17977
|
-
|
17978
18102
|
// Copyright (c) Microsoft Corporation.
|
17979
18103
|
/**
|
17980
18104
|
* @private
|