@azure/communication-react 1.5.1-alpha-202305120012 → 1.5.1-alpha-202305160013

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.
@@ -1944,7 +1944,7 @@ export declare type CallErrors = {
1944
1944
  *
1945
1945
  * @public
1946
1946
  */
1947
- export declare type CallErrorTarget = 'Call.addParticipant' | 'Call.dispose' | 'Call.feature' | 'Call.hangUp' | 'Call.hold' | 'Call.mute' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.muteIncomingAudio' | 'Call.off' | 'Call.on' | 'Call.removeParticipant' | 'Call.resume' | 'Call.sendDtmf' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.startAudio' | 'Call.startScreenSharing' | 'Call.startVideo' | 'Call.stopScreenSharing' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.stopAudio' | 'Call.stopVideo' | 'Call.unmute' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.unmuteIncomingAudio' | 'CallAgent.dispose' | 'CallAgent.feature' | 'CallAgent.join' | 'CallAgent.off' | 'CallAgent.on' | 'CallAgent.startCall' | 'CallClient.createCallAgent' | 'CallClient.createTeamsCallAgent' | 'CallClient.feature' | 'CallClient.getDeviceManager' | /* @conditional-compile-remove(calling-beta-sdk) */ 'CallClient.getEnvironmentInfo' | 'DeviceManager.askDevicePermission' | 'DeviceManager.getCameras' | 'DeviceManager.getMicrophones' | 'DeviceManager.getSpeakers' | 'DeviceManager.off' | 'DeviceManager.on' | 'DeviceManager.selectMicrophone' | 'DeviceManager.selectSpeaker' | 'IncomingCall.accept' | 'IncomingCall.reject' | /* @conditional-compile-remove(calling-beta-sdk) */ /* @conditional-compile-remove(teams-identity-support) */ 'TeamsCall.addParticipant' | /* @conditional-compile-remove(video-background-effects) */ 'VideoEffectsFeature.startEffects' | /* @conditional-compile-remove(calling-beta-sdk) */ 'CallAgent.handlePushNotification' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.admit' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.rejectParticipant' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.admitAll';
1947
+ export declare type CallErrorTarget = 'Call.addParticipant' | 'Call.dispose' | 'Call.feature' | 'Call.hangUp' | 'Call.hold' | 'Call.mute' | 'Call.muteIncomingAudio' | 'Call.off' | 'Call.on' | 'Call.removeParticipant' | 'Call.resume' | 'Call.sendDtmf' | 'Call.startAudio' | 'Call.startScreenSharing' | 'Call.startVideo' | 'Call.stopScreenSharing' | 'Call.stopAudio' | 'Call.stopVideo' | 'Call.unmute' | 'Call.unmuteIncomingAudio' | 'CallAgent.dispose' | 'CallAgent.feature' | 'CallAgent.join' | 'CallAgent.off' | 'CallAgent.on' | 'CallAgent.startCall' | 'CallClient.createCallAgent' | 'CallClient.createTeamsCallAgent' | 'CallClient.feature' | 'CallClient.getDeviceManager' | /* @conditional-compile-remove(calling-beta-sdk) */ 'CallClient.getEnvironmentInfo' | 'DeviceManager.askDevicePermission' | 'DeviceManager.getCameras' | 'DeviceManager.getMicrophones' | 'DeviceManager.getSpeakers' | 'DeviceManager.off' | 'DeviceManager.on' | 'DeviceManager.selectMicrophone' | 'DeviceManager.selectSpeaker' | 'IncomingCall.accept' | 'IncomingCall.reject' | /* @conditional-compile-remove(calling-beta-sdk) */ /* @conditional-compile-remove(teams-identity-support) */ 'TeamsCall.addParticipant' | /* @conditional-compile-remove(video-background-effects) */ 'VideoEffectsFeature.startEffects' | /* @conditional-compile-remove(calling-beta-sdk) */ 'CallAgent.handlePushNotification' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.admit' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.rejectParticipant' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.admitAll';
1948
1948
 
1949
1949
  /**
1950
1950
  * Callback for {@link CallAdapterSubscribers} 'callIdChanged' event.
@@ -164,7 +164,7 @@ const _toCommunicationIdentifier = (id) => {
164
164
  // Copyright (c) Microsoft Corporation.
165
165
  // Licensed under the MIT license.
166
166
  // GENERATED FILE. DO NOT EDIT MANUALLY.
167
- var telemetryVersion = '1.5.1-alpha-202305120012';
167
+ var telemetryVersion = '1.5.1-alpha-202305160013';
168
168
 
169
169
  // Copyright (c) Microsoft Corporation.
170
170
  /**
@@ -1025,9 +1025,15 @@ const _changeSpokenLanguageSelector = reselect__namespace.createSelector([getSup
1025
1025
  * @internal
1026
1026
  */
1027
1027
  const _captionsBannerSelector = reselect__namespace.createSelector([getCaptions, getCaptionsStatus], (captions, isCaptionsFeatureActive) => {
1028
- const captionsInfo = captions === null || captions === void 0 ? void 0 : captions.map((c) => {
1028
+ // Following Teams app logic, no matter how many 'Partial' captions come,
1029
+ // we only pick first one according to start time, and all the other partial captions will be filtered out
1030
+ // This will give customers a stable captions experience when others talking over the dominant speaker
1031
+ const captionsToRender = captions === null || captions === void 0 ? void 0 : captions.filter((captions) => captions.resultType === 'Final');
1032
+ const firstPartialCaptions = captions === null || captions === void 0 ? void 0 : captions.filter((captions) => captions.resultType === 'Partial').sort(captionsComparator)[0];
1033
+ firstPartialCaptions && (captionsToRender === null || captionsToRender === void 0 ? void 0 : captionsToRender.push(firstPartialCaptions));
1034
+ const captionsInfo = captionsToRender === null || captionsToRender === void 0 ? void 0 : captionsToRender.map((c) => {
1029
1035
  var _a, _b;
1030
- const userId = c.speaker.identifier ? toFlatCommunicationIdentifier(c.speaker.identifier) : '';
1036
+ const userId = getCaptionsSpeakerIdentifier(c);
1031
1037
  return {
1032
1038
  id: c.timestamp.getTime() + userId + c.speaker.displayName,
1033
1039
  displayName: (_a = c.speaker.displayName) !== null && _a !== void 0 ? _a : 'Unnamed Participant',
@@ -1040,6 +1046,15 @@ const _captionsBannerSelector = reselect__namespace.createSelector([getCaptions,
1040
1046
  isCaptionsOn: isCaptionsFeatureActive !== null && isCaptionsFeatureActive !== void 0 ? isCaptionsFeatureActive : false
1041
1047
  };
1042
1048
  });
1049
+ /* @conditional-compile-remove(close-captions) */
1050
+ const captionsComparator = (captionsA, captionsB) => {
1051
+ return (captionsA.timestamp.getTime() - captionsB.timestamp.getTime() ||
1052
+ getCaptionsSpeakerIdentifier(captionsA).localeCompare(getCaptionsSpeakerIdentifier(captionsB)));
1053
+ };
1054
+ /* @conditional-compile-remove(close-captions) */
1055
+ const getCaptionsSpeakerIdentifier = (captions) => {
1056
+ return captions.speaker.identifier ? toFlatCommunicationIdentifier(captions.speaker.identifier) : '';
1057
+ };
1043
1058
 
1044
1059
  // Copyright (c) Microsoft Corporation.
1045
1060
  // Licensed under the MIT license.