@azure/communication-react 1.20.0-alpha-202409180015 → 1.20.0-alpha-202409200015

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BNTuqeiU.js → ChatMessageComponentAsRichTextEditBox-Bi4D1IU3.js} +2 -2
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BNTuqeiU.js.map → ChatMessageComponentAsRichTextEditBox-Bi4D1IU3.js.map} +1 -1
  3. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CSJWlyJL.js → RichTextSendBoxWrapper-C__3v7Bo.js} +2 -2
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CSJWlyJL.js.map → RichTextSendBoxWrapper-C__3v7Bo.js.map} +1 -1
  5. package/dist/dist-cjs/communication-react/{index-DOldSEkK.js → index-DHcnNHhY.js} +50 -59
  6. package/dist/dist-cjs/communication-react/index-DHcnNHhY.js.map +1 -0
  7. package/dist/dist-cjs/communication-react/index.js +1 -1
  8. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  10. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +0 -2
  11. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  12. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +3 -10
  13. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  14. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +2 -6
  15. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
  16. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +2 -10
  17. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
  18. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  19. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +0 -1
  20. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  21. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +4 -0
  22. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +31 -9
  23. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  24. package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js +0 -1
  25. package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js.map +1 -1
  26. package/dist/dist-esm/calling-stateful-client/src/Converter.js +0 -4
  27. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  28. package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
  29. package/dist/dist-esm/react-components/src/components/ParticipantList.js +2 -5
  30. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  31. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +4 -9
  32. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  33. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  34. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  35. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js +0 -1
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js.map +1 -1
  37. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +0 -1
  38. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  39. package/package.json +1 -1
  40. package/dist/dist-cjs/communication-react/index-DOldSEkK.js.map +0 -1
@@ -436,7 +436,6 @@ export class CallContext {
436
436
  }
437
437
  });
438
438
  }
439
- /* @conditional-compile-remove(hide-attendee-name) */
440
439
  setHideAttendeeNames(callId, capabilitiesChangeInfo) {
441
440
  this.modifyState((draft) => {
442
441
  const call = draft.calls[this._callIdHistory.latestCallId(callId)];
@@ -1 +1 @@
1
- {"version":3,"file":"CallContext.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/CallContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAgBlC,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAQzD,OAAO,EAAe,kBAAkB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAS,OAAO,EAAE,MAAM,OAAO,CAAC;AAMpE,OAAO,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,gCAAgC;AAC5F,OAAO,EAWL,SAAS,EACV,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,qCAAqC,EAAE,MAAM,aAAa,CAAC;AACpE,qDAAqD;AACrD,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAQ9D,YAAY,EAAE,CAAC;AACf,qDAAqD;AACrD,aAAa,EAAE,CAAC;AAEhB,2CAA2C;AAC3C;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAC1C;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAE/C;;GAEG;AACH,MAAM,OAAO,WAAW;IAUtB,YAAY,MAAmC,EAAE,YAAY,GAAG,EAAE;QAL1D,mBAAc,GAAkB,IAAI,aAAa,EAAE,CAAC;QACpD,eAAU,GAAqD,EAAE,CAAC;QAC1E,iDAAiD;QAC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} from '@azure/communication-common';\nimport {\n AudioDeviceInfo,\n DeviceAccess,\n DominantSpeakersInfo,\n ParticipantRole,\n ScalingMode,\n VideoDeviceInfo\n} from '@azure/communication-calling';\nimport { RaisedHand } from '@azure/communication-calling';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { BreakoutRoom, BreakoutRoomsSettings } from '@azure/communication-calling';\n\nimport { TeamsMeetingAudioConferencingDetails } from '@azure/communication-calling';\nimport { convertConferencePhoneInfo } from './Converter';\n\nimport { CapabilitiesChangeInfo, ParticipantCapabilities } from '@azure/communication-calling';\nimport { TeamsCaptionsInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { CaptionsKind, CaptionsInfo as AcsCaptionsInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\nimport { AzureLogger, createClientLogger, getLogLevel } from '@azure/logger';\nimport { EventEmitter } from 'events';\nimport { enableMapSet, enablePatches, Patch, produce } from 'immer';\nimport {\n CallEndReason,\n CallState as CallStatus,\n RemoteParticipantState as RemoteParticipantStatus\n} from '@azure/communication-calling';\nimport { _safeJSONStringify, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n CallState,\n CallClientState,\n LocalVideoStreamState,\n RemoteParticipantState,\n RemoteVideoStreamState,\n IncomingCallState,\n VideoStreamRendererViewState,\n CallAgentState,\n CallErrors,\n CallErrorTarget,\n CallError\n} from './CallClientState';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { NotificationTarget, CallNotification, CallNotifications } from './CallClientState';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { TeamsIncomingCallState } from './CallClientState';\nimport { CaptionsInfo } from './CallClientState';\nimport { ReactionState } from './CallClientState';\nimport { AcceptedTransfer } from './CallClientState';\nimport { callingStatefulLogger } from './Logger';\nimport { CallIdHistory } from './CallIdHistory';\nimport { LocalVideoStreamVideoEffectsState } from './CallClientState';\nimport { convertFromTeamsSDKToCaptionInfoState } from './Converter';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { convertFromSDKToCaptionInfoState } from './Converter';\nimport { convertFromSDKToRaisedHandState } from './Converter';\nimport { ReactionMessage } from '@azure/communication-calling';\nimport { SpotlightedParticipant } from '@azure/communication-calling';\n/* @conditional-compile-remove(local-recording-notification) */\nimport { LocalRecordingInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(local-recording-notification) */\nimport { RecordingInfo } from '@azure/communication-calling';\n\nenableMapSet();\n// Needed to generate state diff for verbose logging.\nenablePatches();\n\n// TODO: How can we make this configurable?\n/**\n * @private\n */\nexport const MAX_CALL_HISTORY_LENGTH = 10;\n/**\n * @private\n */\nexport const REACTION_ANIMATION_TIME_MS = 4133;\n\n/**\n * @private\n */\nexport class CallContext {\n private _logger: AzureLogger;\n private _state: CallClientState;\n private _emitter: EventEmitter;\n private _atomicId: number;\n private _callIdHistory: CallIdHistory = new CallIdHistory();\n private _timeOutId: { [key: string]: ReturnType<typeof setTimeout> } = {};\n /* @conditional-compile-remove(breakout-rooms) */\n private _latestCallIdsThatPushedNotifications: Partial<Record<NotificationTarget, string>> = {};\n\n constructor(userId: CommunicationIdentifierKind, maxListeners = 50) {\n this._logger = createClientLogger('communication-react:calling-context');\n this._state = {\n calls: {},\n callsEnded: {},\n incomingCalls: {},\n incomingCallsEnded: {},\n deviceManager: {\n isSpeakerSelectionAvailable: false,\n cameras: [],\n microphones: [],\n speakers: [],\n unparentedViews: []\n },\n callAgent: undefined,\n userId: userId,\n /* @conditional-compile-remove(unsupported-browser) */ environmentInfo: undefined,\n latestErrors: {} as CallErrors,\n /* @conditional-compile-remove(breakout-rooms) */ latestNotifications: {} as CallNotifications\n };\n this._emitter = new EventEmitter();\n this._emitter.setMaxListeners(maxListeners);\n this._atomicId = 0;\n }\n\n public getState(): CallClientState {\n return this._state;\n }\n\n public modifyState(modifier: (draft: CallClientState) => void): void {\n const priorState = this._state;\n this._state = produce(this._state, modifier, (patches: Patch[]) => {\n if (getLogLevel() === 'verbose') {\n // Log to `info` because AzureLogger.verbose() doesn't show up in console.\n this._logger.info(`State change: ${_safeJSONStringify(patches)}`);\n }\n });\n if (this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n }\n\n public onStateChange(handler: (state: CallClientState) => void): void {\n this._emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: (state: CallClientState) => void): void {\n this._emitter.off('stateChanged', handler);\n }\n\n // Disposing of the CallAgentDeclarative will not clear the state. If we create a new CallAgentDeclarative, we should\n // make sure the state is clean because any left over state (if previous CallAgentDeclarative was disposed) may be\n // invalid.\n public clearCallRelatedState(): void {\n this.modifyState((draft: CallClientState) => {\n draft.calls = {};\n draft.incomingCalls = {};\n draft.callsEnded = {};\n draft.incomingCallsEnded = {};\n });\n }\n\n public setCallAgent(callAgent: CallAgentState): void {\n this.modifyState((draft: CallClientState) => {\n draft.callAgent = callAgent;\n });\n }\n\n public setCall(call: CallState): void {\n this.modifyState((draft: CallClientState) => {\n const latestCallId = this._callIdHistory.latestCallId(call.id);\n const existingCall = draft.calls[latestCallId];\n if (existingCall) {\n existingCall.callerInfo = call.callerInfo;\n existingCall.state = call.state;\n existingCall.callEndReason = call.callEndReason;\n existingCall.direction = call.direction;\n existingCall.isMuted = call.isMuted;\n existingCall.isScreenSharingOn = call.isScreenSharingOn;\n existingCall.localVideoStreams = call.localVideoStreams;\n existingCall.remoteParticipants = call.remoteParticipants;\n existingCall.transcription.isTranscriptionActive = call.transcription.isTranscriptionActive;\n existingCall.optimalVideoCount.maxRemoteVideoStreams = call.optimalVideoCount.maxRemoteVideoStreams;\n existingCall.recording.isRecordingActive = call.recording.isRecordingActive;\n existingCall.raiseHand.raisedHands = call.raiseHand.raisedHands;\n existingCall.pptLive.isActive = call.pptLive.isActive;\n existingCall.raiseHand.localParticipantRaisedHand = call.raiseHand.localParticipantRaisedHand;\n existingCall.role = call.role;\n /* @conditional-compile-remove(total-participant-count) */\n existingCall.totalParticipantCount = call.totalParticipantCount;\n // We don't update the startTime and endTime if we are updating an existing active call\n existingCall.captionsFeature.currentSpokenLanguage = call.captionsFeature.currentSpokenLanguage;\n existingCall.captionsFeature.currentCaptionLanguage = call.captionsFeature.currentCaptionLanguage;\n existingCall.info = call.info;\n\n existingCall.meetingConference = call.meetingConference;\n } else {\n draft.calls[latestCallId] = call;\n }\n });\n /**\n * Remove the incoming call that matches the call if there is one\n */\n if (this._state.incomingCalls[call.id]) {\n this.removeIncomingCall(call.id);\n }\n }\n\n public removeCall(callId: string): void {\n this.modifyState((draft: CallClientState) => {\n delete draft.calls[this._callIdHistory.latestCallId(callId)];\n });\n }\n\n public setCallEnded(callId: string, callEndReason: CallEndReason | undefined): void {\n const latestCallId = this._callIdHistory.latestCallId(callId);\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[latestCallId];\n if (call) {\n call.endTime = new Date();\n call.callEndReason = callEndReason;\n delete draft.calls[latestCallId];\n // Performance note: This loop should run only once because the number of entries\n // is never allowed to exceed MAX_CALL_HISTORY_LENGTH. A loop is used for correctness.\n while (Object.keys(draft.callsEnded).length >= MAX_CALL_HISTORY_LENGTH) {\n delete draft.callsEnded[findOldestCallEnded(draft.callsEnded)];\n }\n draft.callsEnded[latestCallId] = call;\n }\n });\n }\n\n public setCallState(callId: string, state: CallStatus): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.state = state;\n }\n });\n }\n\n public setCallId(newCallId: string, oldCallId: string): void {\n this._callIdHistory.updateCallIdHistory(newCallId, oldCallId);\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[oldCallId];\n if (call) {\n call.id = newCallId;\n delete draft.calls[oldCallId];\n draft.calls[newCallId] = call;\n }\n /* @conditional-compile-remove(breakout-rooms) */\n // Update the old origin call id of breakout room calls to the new call id\n Object.values(draft.calls).forEach((call) => {\n if (call.breakoutRooms?.breakoutRoomOriginCallId === oldCallId) {\n call.breakoutRooms?.breakoutRoomOriginCallId === newCallId;\n }\n });\n });\n }\n\n /* @conditional-compile-remove(unsupported-browser) */\n public setEnvironmentInfo(envInfo: EnvironmentInfo): void {\n this.modifyState((draft: CallClientState) => {\n draft.environmentInfo = envInfo;\n });\n }\n\n public setCallIsScreenSharingOn(callId: string, isScreenSharingOn: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.isScreenSharingOn = isScreenSharingOn;\n }\n });\n }\n\n public setCallRemoteParticipants(\n callId: string,\n addRemoteParticipant: RemoteParticipantState[],\n removeRemoteParticipant: string[]\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n removeRemoteParticipant.forEach((id: string) => {\n delete call.remoteParticipants[id];\n });\n addRemoteParticipant.forEach((participant: RemoteParticipantState) => {\n call.remoteParticipants[toFlatCommunicationIdentifier(participant.identifier)] = participant;\n });\n }\n });\n }\n\n public setCallRemoteParticipantsEnded(\n callId: string,\n addRemoteParticipant: RemoteParticipantState[],\n removeRemoteParticipant: string[]\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n removeRemoteParticipant.forEach((id: string) => {\n delete call.remoteParticipantsEnded[id];\n });\n addRemoteParticipant.forEach((participant: RemoteParticipantState) => {\n call.remoteParticipantsEnded[toFlatCommunicationIdentifier(participant.identifier)] = participant;\n });\n }\n });\n }\n\n public setCallLocalVideoStream(\n callId: string,\n streamsAdded: LocalVideoStreamState[],\n streamsRemoved: LocalVideoStreamState[]\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n for (const removedStream of streamsRemoved) {\n const index = call.localVideoStreams.findIndex((i) => i.mediaStreamType === removedStream.mediaStreamType);\n if (index > -1) {\n call.localVideoStreams.splice(index, 1);\n }\n }\n\n for (const addedStream of streamsAdded) {\n const index = call.localVideoStreams.findIndex((i) => i.mediaStreamType === addedStream.mediaStreamType);\n if (index > -1) {\n call.localVideoStreams[index] = addedStream;\n } else {\n call.localVideoStreams.push(addedStream);\n }\n }\n }\n });\n }\n\n public setCallLocalVideoStreamVideoEffects(callId: string, videoEffects: LocalVideoStreamVideoEffectsState): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const stream = call.localVideoStreams?.find((i) => i.mediaStreamType === 'Video');\n if (stream) {\n stream.videoEffects = videoEffects;\n }\n }\n });\n }\n\n public setCallIsMicrophoneMuted(callId: string, isMicrophoneMuted: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.isMuted = isMicrophoneMuted;\n }\n });\n }\n\n public setRole(callId: string, role: ParticipantRole): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.role = role;\n }\n });\n }\n\n /* @conditional-compile-remove(total-participant-count) */\n public setTotalParticipantCount(callId: string, totalParticipantCount: number): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.totalParticipantCount = totalParticipantCount;\n }\n });\n }\n\n public setCallDominantSpeakers(callId: string, dominantSpeakers: DominantSpeakersInfo): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.dominantSpeakers = dominantSpeakers;\n }\n });\n }\n\n public setCallRecordingActive(callId: string, isRecordingActive: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.recording.isRecordingActive = isRecordingActive;\n }\n });\n }\n\n /* @conditional-compile-remove(local-recording-notification) */\n public setCallRecordingInfos(\n callId: string,\n recordingInfosAdded: RecordingInfo[],\n lastStoppedRecording: RecordingInfo[]\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.recording.activeRecordings = recordingInfosAdded;\n call.recording.lastStoppedRecording = lastStoppedRecording;\n }\n });\n }\n\n /* @conditional-compile-remove(local-recording-notification) */\n public setCallLocalRecordingActive(callId: string, isRecordingActive: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.localRecording.isLocalRecordingActive = isRecordingActive;\n }\n });\n }\n\n /* @conditional-compile-remove(local-recording-notification) */\n public setCallLocalRecordingInfos(\n callId: string,\n localRecordingInfosAdded: LocalRecordingInfo[],\n lastStoppedRecording: LocalRecordingInfo[]\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.localRecording.activeLocalRecordings = localRecordingInfosAdded;\n call.localRecording.lastStoppedLocalRecording = lastStoppedRecording;\n }\n });\n }\n\n public setCallPPTLiveActive(callId: string, isActive: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.pptLive.isActive = isActive;\n }\n });\n }\n\n public setCallParticipantPPTLive(callId: string, participantKey: string, target: HTMLElement | undefined): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call && participantKey) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.contentSharingStream = target;\n call.contentSharingRemoteParticipant = participantKey;\n }\n }\n });\n }\n\n public setCallRaisedHands(callId: string, raisedHands: RaisedHand[]): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.raiseHand.raisedHands = raisedHands.map((raisedHand) => {\n return convertFromSDKToRaisedHandState(raisedHand);\n });\n const raisedHand = raisedHands.find(\n (raisedHand) =>\n toFlatCommunicationIdentifier(raisedHand.identifier) === toFlatCommunicationIdentifier(this._state.userId)\n );\n if (raisedHand) {\n call.raiseHand.localParticipantRaisedHand = convertFromSDKToRaisedHandState(raisedHand);\n } else {\n call.raiseHand.localParticipantRaisedHand = undefined;\n }\n }\n });\n }\n\n public setParticipantIsRaisedHand(callId: string, participantKey: string, raisedHand: RaisedHand | undefined): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.raisedHand = raisedHand ? convertFromSDKToRaisedHandState(raisedHand) : raisedHand;\n }\n }\n });\n }\n\n public setReceivedReactionFromParticipant(\n callId: string,\n participantKey: string,\n reactionMessage: ReactionMessage | null\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n\n if (!call) {\n return;\n }\n\n clearTimeout(this._timeOutId[participantKey]);\n\n const participant = call.remoteParticipants[participantKey];\n const newReactionState: ReactionState | undefined = reactionMessage\n ? { reactionMessage: reactionMessage, receivedOn: new Date() }\n : undefined;\n\n if (participantKey === toFlatCommunicationIdentifier(this._state.userId)) {\n call.localParticipantReaction = newReactionState;\n } else {\n participant.reactionState = newReactionState;\n }\n\n if (reactionMessage) {\n this._timeOutId[participantKey] = setTimeout(() => {\n clearParticipantReactionState(this, callId, participantKey);\n }, REACTION_ANIMATION_TIME_MS);\n }\n });\n }\n\n public setCallTranscriptionActive(callId: string, isTranscriptionActive: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.transcription.isTranscriptionActive = isTranscriptionActive;\n }\n });\n }\n\n public setCapabilities(\n callId: string,\n capabilities: ParticipantCapabilities,\n capabilitiesChangeInfo: CapabilitiesChangeInfo\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.capabilitiesFeature = { capabilities, latestCapabilitiesChangeInfo: capabilitiesChangeInfo };\n }\n });\n }\n\n /* @conditional-compile-remove(hide-attendee-name) */\n public setHideAttendeeNames(callId: string, capabilitiesChangeInfo: CapabilitiesChangeInfo): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (capabilitiesChangeInfo.oldValue.viewAttendeeNames !== capabilitiesChangeInfo.newValue.viewAttendeeNames) {\n const viewAttendeeNames = capabilitiesChangeInfo.newValue.viewAttendeeNames;\n if (\n call &&\n viewAttendeeNames &&\n !viewAttendeeNames.isPresent &&\n viewAttendeeNames.reason === 'MeetingRestricted'\n ) {\n call.hideAttendeeNames = true;\n } else {\n call.hideAttendeeNames = false;\n }\n }\n });\n }\n\n public setSpotlight(\n callId: string,\n spotlightedParticipants: SpotlightedParticipant[],\n maxParticipantsToSpotlight: number\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.spotlight = { ...call.spotlight, spotlightedParticipants, maxParticipantsToSpotlight };\n }\n });\n }\n\n public setTeamsMeetingConference(\n callId: string,\n teamsMeetingConferenceDetails: TeamsMeetingAudioConferencingDetails\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.meetingConference = { conferencePhones: convertConferencePhoneInfo(teamsMeetingConferenceDetails) };\n }\n });\n }\n\n public setParticipantSpotlighted(callId: string, spotlightedParticipant: SpotlightedParticipant): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[toFlatCommunicationIdentifier(spotlightedParticipant.identifier)];\n if (participant) {\n participant.spotlight = { spotlightedOrderPosition: spotlightedParticipant.order };\n } else if (\n call.spotlight &&\n toFlatCommunicationIdentifier(draft.userId) ===\n toFlatCommunicationIdentifier(spotlightedParticipant.identifier)\n ) {\n call.spotlight.localParticipantSpotlight = { spotlightedOrderPosition: spotlightedParticipant.order };\n }\n }\n });\n }\n\n public setParticipantNotSpotlighted(callId: string, spotlightedParticipant: SpotlightedParticipant): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[toFlatCommunicationIdentifier(spotlightedParticipant.identifier)];\n if (participant) {\n participant.spotlight = undefined;\n } else if (\n call.spotlight &&\n toFlatCommunicationIdentifier(draft.userId) ===\n toFlatCommunicationIdentifier(spotlightedParticipant.identifier)\n ) {\n call.spotlight.localParticipantSpotlight = undefined;\n }\n }\n });\n }\n\n /* @conditional-compile-remove(breakout-rooms) */\n public setAssignedBreakoutRoom(callId: string, breakoutRoom?: BreakoutRoom): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.breakoutRooms = { ...call.breakoutRooms, assignedBreakoutRoom: breakoutRoom };\n }\n });\n }\n\n /* @conditional-compile-remove(breakout-rooms) */\n public setBreakoutRoomOriginCallId(callId: string, breakoutRoomCallId: string): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(breakoutRoomCallId)];\n if (call) {\n call.breakoutRooms = { ...call.breakoutRooms, breakoutRoomOriginCallId: callId };\n }\n });\n }\n\n /* @conditional-compile-remove(breakout-rooms) */\n public setBreakoutRoomSettings(callId: string, breakoutRoomSettings: BreakoutRoomsSettings): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.breakoutRooms = { ...call.breakoutRooms, breakoutRoomSettings: breakoutRoomSettings };\n }\n });\n }\n\n /* @conditional-compile-remove(breakout-rooms) */\n public setBreakoutRoomDisplayName(callId: string, breakoutRoomDisplayName: string): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.breakoutRooms = { ...call.breakoutRooms, breakoutRoomDisplayName };\n }\n });\n }\n\n public setCallScreenShareParticipant(callId: string, participantKey: string | undefined): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.screenShareRemoteParticipant = participantKey;\n }\n });\n }\n\n public setLocalVideoStreamRendererView(\n callId: string,\n localVideoMediaStreamType: string,\n view: VideoStreamRendererViewState | undefined\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const localVideoStream = call.localVideoStreams.find(\n (localVideoStream) => localVideoStream.mediaStreamType === localVideoMediaStreamType\n );\n if (localVideoStream) {\n localVideoStream.view = view;\n }\n }\n });\n }\n\n public setParticipantState(callId: string, participantKey: string, state: RemoteParticipantStatus): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.state = state;\n }\n }\n });\n }\n\n public setParticipantIsMuted(callId: string, participantKey: string, muted: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.isMuted = muted;\n }\n }\n });\n }\n\n public setOptimalVideoCount(callId: string, optimalVideoCount: number): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.optimalVideoCount.maxRemoteVideoStreams = optimalVideoCount;\n }\n });\n }\n\n public setParticipantRole(callId: string, participantKey: string, role: ParticipantRole): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.role = role;\n }\n }\n });\n }\n\n public setParticipantDisplayName(callId: string, participantKey: string, displayName: string): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.displayName = displayName;\n }\n }\n });\n }\n\n public setParticipantIsSpeaking(callId: string, participantKey: string, isSpeaking: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.isSpeaking = isSpeaking;\n }\n }\n });\n }\n\n public setParticipantVideoStream(callId: string, participantKey: string, stream: RemoteVideoStreamState): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n // Set is called by subscriber will not modify any rendered stream so if there is existing stream only\n // modify the values that subscriber has access to.\n const existingStream = participant.videoStreams[stream.id];\n if (existingStream) {\n existingStream.isAvailable = stream.isAvailable;\n existingStream.isReceiving = stream.isReceiving;\n existingStream.mediaStreamType = stream.mediaStreamType;\n } else {\n participant.videoStreams[stream.id] = stream;\n }\n }\n }\n });\n }\n\n public setRemoteVideoStreamIsAvailable(\n callId: string,\n participantKey: string,\n streamId: number,\n isAvailable: boolean\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n const stream = participant.videoStreams[streamId];\n if (stream) {\n stream.isAvailable = isAvailable;\n }\n }\n }\n });\n }\n\n public setRemoteVideoStreamIsReceiving(\n callId: string,\n participantKey: string,\n streamId: number,\n isReceiving: boolean\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n const stream = participant.videoStreams[streamId];\n if (stream) {\n stream.isReceiving = isReceiving;\n }\n }\n }\n });\n }\n\n public setRemoteVideoStreamSize(\n callId: string,\n participantKey: string,\n streamId: number,\n size: { width: number; height: number }\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n const stream = participant.videoStreams[streamId];\n if (stream) {\n stream.streamSize = size;\n }\n }\n }\n });\n }\n\n public setRemoteVideoStreams(\n callId: string,\n participantKey: string,\n addRemoteVideoStream: RemoteVideoStreamState[],\n removeRemoteVideoStream: number[]\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n for (const id of removeRemoteVideoStream) {\n delete participant.videoStreams[id];\n }\n\n for (const newStream of addRemoteVideoStream) {\n // This should only be called by the subscriber and some properties are add by other components so if the\n // stream already exists, only update the values that subscriber knows about.\n const stream = participant.videoStreams[newStream.id];\n if (stream) {\n stream.mediaStreamType = newStream.mediaStreamType;\n stream.isAvailable = newStream.isAvailable;\n stream.isReceiving = newStream.isReceiving;\n } else {\n participant.videoStreams[newStream.id] = newStream;\n }\n }\n }\n }\n });\n }\n\n public setRemoteVideoStreamRendererView(\n callId: string,\n participantKey: string,\n streamId: number,\n view: VideoStreamRendererViewState | undefined\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n const stream = participant.videoStreams[streamId];\n if (stream) {\n stream.view = view;\n }\n }\n }\n });\n }\n\n public setRemoteVideoStreamViewScalingMode(\n callId: string,\n participantKey: string,\n streamId: number,\n scalingMode: ScalingMode\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n const stream = participant.videoStreams[streamId];\n if (stream && stream.view) {\n stream.view.scalingMode = scalingMode;\n }\n }\n }\n });\n }\n\n public setIncomingCall(\n call: IncomingCallState | /* @conditional-compile-remove(one-to-n-calling) */ TeamsIncomingCallState\n ): void {\n this.modifyState((draft: CallClientState) => {\n const existingCall = draft.incomingCalls[call.id];\n if (existingCall) {\n existingCall.callerInfo = call.callerInfo;\n } else {\n draft.incomingCalls[call.id] = call;\n }\n });\n }\n\n public removeIncomingCall(callId: string): void {\n this.modifyState((draft: CallClientState) => {\n delete draft.incomingCalls[callId];\n });\n }\n\n public setIncomingCallEnded(callId: string, callEndReason: CallEndReason | undefined): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.incomingCalls[callId];\n if (call) {\n call.endTime = new Date();\n call.callEndReason = callEndReason;\n delete draft.incomingCalls[callId];\n // Performance note: This loop should run only once because the number of entries\n // is never allowed to exceed MAX_CALL_HISTORY_LENGTH. A loop is used for correctness.\n while (Object.keys(draft.incomingCallsEnded).length >= MAX_CALL_HISTORY_LENGTH) {\n delete draft.incomingCallsEnded[findOldestCallEnded(draft.incomingCallsEnded)];\n }\n draft.incomingCallsEnded[callId] = call;\n }\n });\n }\n\n public setDeviceManagerIsSpeakerSelectionAvailable(isSpeakerSelectionAvailable: boolean): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.isSpeakerSelectionAvailable = isSpeakerSelectionAvailable;\n });\n }\n\n public setDeviceManagerSelectedMicrophone(selectedMicrophone?: AudioDeviceInfo): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.selectedMicrophone = selectedMicrophone;\n });\n }\n\n public setDeviceManagerSelectedSpeaker(selectedSpeaker?: AudioDeviceInfo): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.selectedSpeaker = selectedSpeaker;\n });\n }\n\n public setDeviceManagerSelectedCamera(selectedCamera?: VideoDeviceInfo): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.selectedCamera = selectedCamera;\n });\n }\n\n public setDeviceManagerCameras(cameras: VideoDeviceInfo[]): void {\n this.modifyState((draft: CallClientState) => {\n /**\n * SDK initializes cameras with one dummy camera with value { id: 'camera:id', name: '', deviceType: 'USBCamera' } immediately after\n * camera permissions are granted. So selectedCamera will have this value before the actual cameras are obtained. Therefore we should reset\n * selectedCamera to the first camera when there are cameras AND when current selectedCamera does not exist in the new array of cameras *\n */\n if (cameras.length > 0 && !cameras.some((camera) => camera.id === draft.deviceManager.selectedCamera?.id)) {\n draft.deviceManager.selectedCamera = cameras[0];\n }\n draft.deviceManager.cameras = cameras;\n });\n }\n\n public setDeviceManagerMicrophones(microphones: AudioDeviceInfo[]): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.microphones = microphones;\n });\n }\n\n public setDeviceManagerSpeakers(speakers: AudioDeviceInfo[]): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.speakers = speakers;\n });\n }\n\n public setDeviceManagerDeviceAccess(deviceAccess: DeviceAccess): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.deviceAccess = deviceAccess;\n });\n }\n\n public setDeviceManagerUnparentedView(\n localVideoStream: LocalVideoStreamState,\n view: VideoStreamRendererViewState | undefined\n ): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.unparentedViews.push({\n source: localVideoStream.source,\n mediaStreamType: localVideoStream.mediaStreamType,\n view: view\n });\n });\n }\n\n public deleteDeviceManagerUnparentedView(localVideoStream: LocalVideoStreamState): void {\n this.modifyState((draft: CallClientState) => {\n const foundIndex = draft.deviceManager.unparentedViews.findIndex(\n (stream) => stream.mediaStreamType === localVideoStream.mediaStreamType\n );\n if (foundIndex !== -1) {\n draft.deviceManager.unparentedViews.splice(foundIndex, 1);\n }\n });\n }\n\n public setDeviceManagerUnparentedViewVideoEffects(\n localVideoStream: LocalVideoStreamState,\n videoEffects: LocalVideoStreamVideoEffectsState\n ): void {\n this.modifyState((draft: CallClientState) => {\n const foundIndex = draft.deviceManager.unparentedViews.findIndex(\n (stream) => stream.mediaStreamType === localVideoStream.mediaStreamType\n );\n if (foundIndex !== -1) {\n draft.deviceManager.unparentedViews[foundIndex].videoEffects = videoEffects;\n }\n });\n }\n\n public getAndIncrementAtomicId(): number {\n const id = this._atomicId;\n this._atomicId++;\n return id;\n }\n\n private processNewCaption(captions: CaptionsInfo[], newCaption: CaptionsInfo): void {\n // time stamp when new caption comes in\n newCaption.timestamp = new Date();\n // if this is the first caption, push it in\n if (captions.length === 0) {\n captions.push(newCaption);\n }\n // if the last caption is final, then push the new one in\n else if (captions[captions.length - 1].resultType === 'Final') {\n captions.push(newCaption);\n }\n // if the last caption is Partial, then check if the speaker is the same as the new caption, if so, update the last caption\n else {\n if (\n toFlatCommunicationIdentifier(\n captions[captions.length - 1].speaker.identifier as CommunicationIdentifierKind\n ) === toFlatCommunicationIdentifier(newCaption.speaker.identifier as CommunicationIdentifierKind)\n ) {\n captions[captions.length - 1] = newCaption;\n }\n // if different speaker, ignore the interjector until the current speaker finishes\n // edge case: if we dont receive the final caption from the current speaker for 5 secs, we turn the current speaker caption to final and push in the new interjector\n else {\n if (Date.now() - captions[captions.length - 1].timestamp.getTime() > 5000) {\n captions[captions.length - 1].resultType = 'Final';\n captions.push(newCaption);\n }\n }\n }\n\n // If the array length exceeds 50, remove the oldest caption\n if (captions.length > 50) {\n captions.shift();\n }\n }\n\n public addTeamsCaption(callId: string, caption: TeamsCaptionsInfo): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const currentCaptionLanguage = call.captionsFeature.currentCaptionLanguage;\n if (\n caption.captionLanguage.toUpperCase() === currentCaptionLanguage.toUpperCase() ||\n currentCaptionLanguage === '' ||\n currentCaptionLanguage === undefined\n ) {\n this.processNewCaption(call.captionsFeature.captions, convertFromTeamsSDKToCaptionInfoState(caption));\n }\n }\n });\n }\n\n /* @conditional-compile-remove(acs-close-captions) */\n public addCaption(callId: string, caption: AcsCaptionsInfo): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n this.processNewCaption(call.captionsFeature.captions, convertFromSDKToCaptionInfoState(caption));\n }\n });\n }\n\n /* @conditional-compile-remove(acs-close-captions) */\n public setCaptionsKind(callId: string, kind: CaptionsKind): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.captionsKind = kind;\n }\n });\n }\n\n public clearCaptions(callId: string): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.captions = [];\n }\n });\n }\n\n setIsCaptionActive(callId: string, isCaptionsActive: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.isCaptionsFeatureActive = isCaptionsActive;\n }\n });\n }\n\n setStartCaptionsInProgress(callId: string, startCaptionsInProgress: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.startCaptionsInProgress = startCaptionsInProgress;\n }\n });\n }\n\n setSelectedSpokenLanguage(callId: string, spokenLanguage: string): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.currentSpokenLanguage = spokenLanguage;\n }\n });\n }\n\n setSelectedCaptionLanguage(callId: string, captionLanguage: string): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.currentCaptionLanguage = captionLanguage;\n }\n });\n }\n\n setAvailableCaptionLanguages(callId: string, captionLanguages: string[]): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.supportedCaptionLanguages = captionLanguages;\n }\n });\n }\n\n setAvailableSpokenLanguages(callId: string, spokenLanguages: string[]): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.supportedSpokenLanguages = spokenLanguages;\n }\n });\n }\n\n setAcceptedTransfer(callId: string, acceptedTransfer: AcceptedTransfer): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.transfer.acceptedTransfers[acceptedTransfer.callId] = acceptedTransfer;\n }\n });\n }\n\n /**\n * Tees any errors encountered in an async function to the state.\n *\n * @param action Async function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withAsyncErrorTeedToState<Args extends unknown[], R>(\n action: (...args: Args) => Promise<R>,\n target: CallErrorTarget\n ): (...args: Args) => Promise<R> {\n return async (...args: Args): Promise<R> => {\n try {\n return await action(...args);\n } catch (error) {\n const callError = toCallError(target, error);\n this.setLatestError(target, callError);\n throw callError;\n }\n };\n }\n\n /**\n * Tees any errors encountered in an function to the state.\n *\n * @param action Function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withErrorTeedToState<Args extends unknown[], R>(\n action: (...args: Args) => R,\n target: CallErrorTarget\n ): (...args: Args) => R {\n return (...args: Args): R => {\n try {\n callingStatefulLogger.info(`Calling stateful client target function called: ${target}`);\n return action(...args);\n } catch (error) {\n const callError = toCallError(target, error);\n this.setLatestError(target, callError);\n throw callError;\n }\n };\n }\n\n /**\n * Tees direct errors to state.\n * @remarks\n * This is typically used for errors that are caught and intended to be shown to the user.\n *\n * @param error The raw error to report.\n * @param target The error target to tee error to.\n *\n * @private\n */\n public teeErrorToState = (error: Error, target: CallErrorTarget): void => {\n const callError = toCallError(target, error);\n this.setLatestError(target, callError);\n };\n\n private setLatestError(target: CallErrorTarget, error: CallError): void {\n this.modifyState((draft: CallClientState) => {\n draft.latestErrors[target] = error;\n });\n }\n\n /* @conditional-compile-remove(breakout-rooms) */\n public setLatestNotification(callId: string, notification: CallNotification): void {\n this._latestCallIdsThatPushedNotifications[notification.target] = callId;\n this.modifyState((draft: CallClientState) => {\n draft.latestNotifications[notification.target] = notification;\n });\n }\n\n /* @conditional-compile-remove(breakout-rooms) */\n public deleteLatestNotification(callId: string, notificationTarget: NotificationTarget): void {\n let callIdToPushLatestNotification = this._latestCallIdsThatPushedNotifications[notificationTarget];\n callIdToPushLatestNotification = callIdToPushLatestNotification\n ? this._callIdHistory.latestCallId(callIdToPushLatestNotification)\n : undefined;\n // Only delete the notification if the call that pushed the notification is the same as the call that is trying\n // to delete it.\n if (callIdToPushLatestNotification !== callId) {\n return;\n }\n\n this.modifyState((draft: CallClientState) => {\n delete draft.latestNotifications[notificationTarget];\n });\n }\n}\n\nconst toCallError = (target: CallErrorTarget, error: unknown): CallError => {\n if (error instanceof Error) {\n return new CallError(target, error);\n }\n return new CallError(target, new Error(error as string));\n};\n\nconst findOldestCallEnded = (calls: { [key: string]: { endTime?: Date } }): string => {\n const callEntries = Object.entries(calls);\n let [oldestCallId, oldestCall] = callEntries[0];\n if (oldestCall.endTime === undefined) {\n return oldestCallId;\n }\n for (const [callId, call] of callEntries.slice(1)) {\n if (call.endTime === undefined) {\n return callId;\n }\n if ((call.endTime?.getTime() ?? 0) < (oldestCall.endTime?.getTime() ?? 0)) {\n [oldestCallId, oldestCall] = [callId, call];\n }\n }\n return oldestCallId;\n};\n\nfunction clearParticipantReactionState(callContext: CallContext, callId: string, participantKey: string): void {\n callContext.setReceivedReactionFromParticipant(callId, participantKey, null);\n}\n"]}
1
+ {"version":3,"file":"CallContext.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/CallContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAgBlC,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAQzD,OAAO,EAAe,kBAAkB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,O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I,UAAU,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACrC,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,KAAK,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC/B,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,IAAI,CAAC,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,EAAE,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,MAAA,UAAU,CAAC,OAAO,0CAAE,OAAO,EAAE,mCAAI,CAAC,CAAC,EAAE,CAAC;YAC1E,CAAC,YAAY,EAAE,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF,SAAS,6BAA6B,CAAC,WAAwB,EAAE,MAAc,EAAE,cAAsB;IACrG,WAAW,CAAC,kCAAkC,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport {\n AudioDeviceInfo,\n DeviceAccess,\n DominantSpeakersInfo,\n ParticipantRole,\n ScalingMode,\n VideoDeviceInfo\n} from '@azure/communication-calling';\nimport { RaisedHand } from '@azure/communication-calling';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { BreakoutRoom, BreakoutRoomsSettings } from '@azure/communication-calling';\n\nimport { TeamsMeetingAudioConferencingDetails } from '@azure/communication-calling';\nimport { convertConferencePhoneInfo } from './Converter';\n\nimport { CapabilitiesChangeInfo, ParticipantCapabilities } from '@azure/communication-calling';\nimport { TeamsCaptionsInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { CaptionsKind, CaptionsInfo as AcsCaptionsInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\nimport { AzureLogger, createClientLogger, getLogLevel } from '@azure/logger';\nimport { EventEmitter } from 'events';\nimport { enableMapSet, enablePatches, Patch, produce } from 'immer';\nimport {\n CallEndReason,\n CallState as CallStatus,\n RemoteParticipantState as RemoteParticipantStatus\n} from '@azure/communication-calling';\nimport { _safeJSONStringify, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n CallState,\n CallClientState,\n LocalVideoStreamState,\n RemoteParticipantState,\n RemoteVideoStreamState,\n IncomingCallState,\n VideoStreamRendererViewState,\n CallAgentState,\n CallErrors,\n CallErrorTarget,\n CallError\n} from './CallClientState';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { NotificationTarget, CallNotification, CallNotifications } from './CallClientState';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { TeamsIncomingCallState } from './CallClientState';\nimport { CaptionsInfo } from './CallClientState';\nimport { ReactionState } from './CallClientState';\nimport { AcceptedTransfer } from './CallClientState';\nimport { callingStatefulLogger } from './Logger';\nimport { CallIdHistory } from './CallIdHistory';\nimport { LocalVideoStreamVideoEffectsState } from './CallClientState';\nimport { convertFromTeamsSDKToCaptionInfoState } from './Converter';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { convertFromSDKToCaptionInfoState } from './Converter';\nimport { convertFromSDKToRaisedHandState } from './Converter';\nimport { ReactionMessage } from '@azure/communication-calling';\nimport { SpotlightedParticipant } from '@azure/communication-calling';\n/* @conditional-compile-remove(local-recording-notification) */\nimport { LocalRecordingInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(local-recording-notification) */\nimport { RecordingInfo } from '@azure/communication-calling';\n\nenableMapSet();\n// Needed to generate state diff for verbose logging.\nenablePatches();\n\n// TODO: How can we make this configurable?\n/**\n * @private\n */\nexport const MAX_CALL_HISTORY_LENGTH = 10;\n/**\n * @private\n */\nexport const REACTION_ANIMATION_TIME_MS = 4133;\n\n/**\n * @private\n */\nexport class CallContext {\n private _logger: AzureLogger;\n private _state: CallClientState;\n private _emitter: EventEmitter;\n private _atomicId: number;\n private _callIdHistory: CallIdHistory = new CallIdHistory();\n private _timeOutId: { [key: string]: ReturnType<typeof setTimeout> } = {};\n /* @conditional-compile-remove(breakout-rooms) */\n private _latestCallIdsThatPushedNotifications: Partial<Record<NotificationTarget, string>> = {};\n\n constructor(userId: CommunicationIdentifierKind, maxListeners = 50) {\n this._logger = createClientLogger('communication-react:calling-context');\n this._state = {\n calls: {},\n callsEnded: {},\n incomingCalls: {},\n incomingCallsEnded: {},\n deviceManager: {\n isSpeakerSelectionAvailable: false,\n cameras: [],\n microphones: [],\n speakers: [],\n unparentedViews: []\n },\n callAgent: undefined,\n userId: userId,\n /* @conditional-compile-remove(unsupported-browser) */ environmentInfo: undefined,\n latestErrors: {} as CallErrors,\n /* @conditional-compile-remove(breakout-rooms) */ latestNotifications: {} as CallNotifications\n };\n this._emitter = new EventEmitter();\n this._emitter.setMaxListeners(maxListeners);\n this._atomicId = 0;\n }\n\n public getState(): CallClientState {\n return this._state;\n }\n\n public modifyState(modifier: (draft: CallClientState) => void): void {\n const priorState = this._state;\n this._state = produce(this._state, modifier, (patches: Patch[]) => {\n if (getLogLevel() === 'verbose') {\n // Log to `info` because AzureLogger.verbose() doesn't show up in console.\n this._logger.info(`State change: ${_safeJSONStringify(patches)}`);\n }\n });\n if (this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n }\n\n public onStateChange(handler: (state: CallClientState) => void): void {\n this._emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: (state: CallClientState) => void): void {\n this._emitter.off('stateChanged', handler);\n }\n\n // Disposing of the CallAgentDeclarative will not clear the state. If we create a new CallAgentDeclarative, we should\n // make sure the state is clean because any left over state (if previous CallAgentDeclarative was disposed) may be\n // invalid.\n public clearCallRelatedState(): void {\n this.modifyState((draft: CallClientState) => {\n draft.calls = {};\n draft.incomingCalls = {};\n draft.callsEnded = {};\n draft.incomingCallsEnded = {};\n });\n }\n\n public setCallAgent(callAgent: CallAgentState): void {\n this.modifyState((draft: CallClientState) => {\n draft.callAgent = callAgent;\n });\n }\n\n public setCall(call: CallState): void {\n this.modifyState((draft: CallClientState) => {\n const latestCallId = this._callIdHistory.latestCallId(call.id);\n const existingCall = draft.calls[latestCallId];\n if (existingCall) {\n existingCall.callerInfo = call.callerInfo;\n existingCall.state = call.state;\n existingCall.callEndReason = call.callEndReason;\n existingCall.direction = call.direction;\n existingCall.isMuted = call.isMuted;\n existingCall.isScreenSharingOn = call.isScreenSharingOn;\n existingCall.localVideoStreams = call.localVideoStreams;\n existingCall.remoteParticipants = call.remoteParticipants;\n existingCall.transcription.isTranscriptionActive = call.transcription.isTranscriptionActive;\n existingCall.optimalVideoCount.maxRemoteVideoStreams = call.optimalVideoCount.maxRemoteVideoStreams;\n existingCall.recording.isRecordingActive = call.recording.isRecordingActive;\n existingCall.raiseHand.raisedHands = call.raiseHand.raisedHands;\n existingCall.pptLive.isActive = call.pptLive.isActive;\n existingCall.raiseHand.localParticipantRaisedHand = call.raiseHand.localParticipantRaisedHand;\n existingCall.role = call.role;\n /* @conditional-compile-remove(total-participant-count) */\n existingCall.totalParticipantCount = call.totalParticipantCount;\n // We don't update the startTime and endTime if we are updating an existing active call\n existingCall.captionsFeature.currentSpokenLanguage = call.captionsFeature.currentSpokenLanguage;\n existingCall.captionsFeature.currentCaptionLanguage = call.captionsFeature.currentCaptionLanguage;\n existingCall.info = call.info;\n\n existingCall.meetingConference = call.meetingConference;\n } else {\n draft.calls[latestCallId] = call;\n }\n });\n /**\n * Remove the incoming call that matches the call if there is one\n */\n if (this._state.incomingCalls[call.id]) {\n this.removeIncomingCall(call.id);\n }\n }\n\n public removeCall(callId: string): void {\n this.modifyState((draft: CallClientState) => {\n delete draft.calls[this._callIdHistory.latestCallId(callId)];\n });\n }\n\n public setCallEnded(callId: string, callEndReason: CallEndReason | undefined): void {\n const latestCallId = this._callIdHistory.latestCallId(callId);\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[latestCallId];\n if (call) {\n call.endTime = new Date();\n call.callEndReason = callEndReason;\n delete draft.calls[latestCallId];\n // Performance note: This loop should run only once because the number of entries\n // is never allowed to exceed MAX_CALL_HISTORY_LENGTH. A loop is used for correctness.\n while (Object.keys(draft.callsEnded).length >= MAX_CALL_HISTORY_LENGTH) {\n delete draft.callsEnded[findOldestCallEnded(draft.callsEnded)];\n }\n draft.callsEnded[latestCallId] = call;\n }\n });\n }\n\n public setCallState(callId: string, state: CallStatus): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.state = state;\n }\n });\n }\n\n public setCallId(newCallId: string, oldCallId: string): void {\n this._callIdHistory.updateCallIdHistory(newCallId, oldCallId);\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[oldCallId];\n if (call) {\n call.id = newCallId;\n delete draft.calls[oldCallId];\n draft.calls[newCallId] = call;\n }\n /* @conditional-compile-remove(breakout-rooms) */\n // Update the old origin call id of breakout room calls to the new call id\n Object.values(draft.calls).forEach((call) => {\n if (call.breakoutRooms?.breakoutRoomOriginCallId === oldCallId) {\n call.breakoutRooms?.breakoutRoomOriginCallId === newCallId;\n }\n });\n });\n }\n\n /* @conditional-compile-remove(unsupported-browser) */\n public setEnvironmentInfo(envInfo: EnvironmentInfo): void {\n this.modifyState((draft: CallClientState) => {\n draft.environmentInfo = envInfo;\n });\n }\n\n public setCallIsScreenSharingOn(callId: string, isScreenSharingOn: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.isScreenSharingOn = isScreenSharingOn;\n }\n });\n }\n\n public setCallRemoteParticipants(\n callId: string,\n addRemoteParticipant: RemoteParticipantState[],\n removeRemoteParticipant: string[]\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n removeRemoteParticipant.forEach((id: string) => {\n delete call.remoteParticipants[id];\n });\n addRemoteParticipant.forEach((participant: RemoteParticipantState) => {\n call.remoteParticipants[toFlatCommunicationIdentifier(participant.identifier)] = participant;\n });\n }\n });\n }\n\n public setCallRemoteParticipantsEnded(\n callId: string,\n addRemoteParticipant: RemoteParticipantState[],\n removeRemoteParticipant: string[]\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n removeRemoteParticipant.forEach((id: string) => {\n delete call.remoteParticipantsEnded[id];\n });\n addRemoteParticipant.forEach((participant: RemoteParticipantState) => {\n call.remoteParticipantsEnded[toFlatCommunicationIdentifier(participant.identifier)] = participant;\n });\n }\n });\n }\n\n public setCallLocalVideoStream(\n callId: string,\n streamsAdded: LocalVideoStreamState[],\n streamsRemoved: LocalVideoStreamState[]\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n for (const removedStream of streamsRemoved) {\n const index = call.localVideoStreams.findIndex((i) => i.mediaStreamType === removedStream.mediaStreamType);\n if (index > -1) {\n call.localVideoStreams.splice(index, 1);\n }\n }\n\n for (const addedStream of streamsAdded) {\n const index = call.localVideoStreams.findIndex((i) => i.mediaStreamType === addedStream.mediaStreamType);\n if (index > -1) {\n call.localVideoStreams[index] = addedStream;\n } else {\n call.localVideoStreams.push(addedStream);\n }\n }\n }\n });\n }\n\n public setCallLocalVideoStreamVideoEffects(callId: string, videoEffects: LocalVideoStreamVideoEffectsState): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const stream = call.localVideoStreams?.find((i) => i.mediaStreamType === 'Video');\n if (stream) {\n stream.videoEffects = videoEffects;\n }\n }\n });\n }\n\n public setCallIsMicrophoneMuted(callId: string, isMicrophoneMuted: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.isMuted = isMicrophoneMuted;\n }\n });\n }\n\n public setRole(callId: string, role: ParticipantRole): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.role = role;\n }\n });\n }\n\n /* @conditional-compile-remove(total-participant-count) */\n public setTotalParticipantCount(callId: string, totalParticipantCount: number): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.totalParticipantCount = totalParticipantCount;\n }\n });\n }\n\n public setCallDominantSpeakers(callId: string, dominantSpeakers: DominantSpeakersInfo): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.dominantSpeakers = dominantSpeakers;\n }\n });\n }\n\n public setCallRecordingActive(callId: string, isRecordingActive: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.recording.isRecordingActive = isRecordingActive;\n }\n });\n }\n\n /* @conditional-compile-remove(local-recording-notification) */\n public setCallRecordingInfos(\n callId: string,\n recordingInfosAdded: RecordingInfo[],\n lastStoppedRecording: RecordingInfo[]\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.recording.activeRecordings = recordingInfosAdded;\n call.recording.lastStoppedRecording = lastStoppedRecording;\n }\n });\n }\n\n /* @conditional-compile-remove(local-recording-notification) */\n public setCallLocalRecordingActive(callId: string, isRecordingActive: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.localRecording.isLocalRecordingActive = isRecordingActive;\n }\n });\n }\n\n /* @conditional-compile-remove(local-recording-notification) */\n public setCallLocalRecordingInfos(\n callId: string,\n localRecordingInfosAdded: LocalRecordingInfo[],\n lastStoppedRecording: LocalRecordingInfo[]\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.localRecording.activeLocalRecordings = localRecordingInfosAdded;\n call.localRecording.lastStoppedLocalRecording = lastStoppedRecording;\n }\n });\n }\n\n public setCallPPTLiveActive(callId: string, isActive: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.pptLive.isActive = isActive;\n }\n });\n }\n\n public setCallParticipantPPTLive(callId: string, participantKey: string, target: HTMLElement | undefined): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call && participantKey) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.contentSharingStream = target;\n call.contentSharingRemoteParticipant = participantKey;\n }\n }\n });\n }\n\n public setCallRaisedHands(callId: string, raisedHands: RaisedHand[]): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.raiseHand.raisedHands = raisedHands.map((raisedHand) => {\n return convertFromSDKToRaisedHandState(raisedHand);\n });\n const raisedHand = raisedHands.find(\n (raisedHand) =>\n toFlatCommunicationIdentifier(raisedHand.identifier) === toFlatCommunicationIdentifier(this._state.userId)\n );\n if (raisedHand) {\n call.raiseHand.localParticipantRaisedHand = convertFromSDKToRaisedHandState(raisedHand);\n } else {\n call.raiseHand.localParticipantRaisedHand = undefined;\n }\n }\n });\n }\n\n public setParticipantIsRaisedHand(callId: string, participantKey: string, raisedHand: RaisedHand | undefined): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.raisedHand = raisedHand ? convertFromSDKToRaisedHandState(raisedHand) : raisedHand;\n }\n }\n });\n }\n\n public setReceivedReactionFromParticipant(\n callId: string,\n participantKey: string,\n reactionMessage: ReactionMessage | null\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n\n if (!call) {\n return;\n }\n\n clearTimeout(this._timeOutId[participantKey]);\n\n const participant = call.remoteParticipants[participantKey];\n const newReactionState: ReactionState | undefined = reactionMessage\n ? { reactionMessage: reactionMessage, receivedOn: new Date() }\n : undefined;\n\n if (participantKey === toFlatCommunicationIdentifier(this._state.userId)) {\n call.localParticipantReaction = newReactionState;\n } else {\n participant.reactionState = newReactionState;\n }\n\n if (reactionMessage) {\n this._timeOutId[participantKey] = setTimeout(() => {\n clearParticipantReactionState(this, callId, participantKey);\n }, REACTION_ANIMATION_TIME_MS);\n }\n });\n }\n\n public setCallTranscriptionActive(callId: string, isTranscriptionActive: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.transcription.isTranscriptionActive = isTranscriptionActive;\n }\n });\n }\n\n public setCapabilities(\n callId: string,\n capabilities: ParticipantCapabilities,\n capabilitiesChangeInfo: CapabilitiesChangeInfo\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.capabilitiesFeature = { capabilities, latestCapabilitiesChangeInfo: capabilitiesChangeInfo };\n }\n });\n }\n\n public setHideAttendeeNames(callId: string, capabilitiesChangeInfo: CapabilitiesChangeInfo): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (capabilitiesChangeInfo.oldValue.viewAttendeeNames !== capabilitiesChangeInfo.newValue.viewAttendeeNames) {\n const viewAttendeeNames = capabilitiesChangeInfo.newValue.viewAttendeeNames;\n if (\n call &&\n viewAttendeeNames &&\n !viewAttendeeNames.isPresent &&\n viewAttendeeNames.reason === 'MeetingRestricted'\n ) {\n call.hideAttendeeNames = true;\n } else {\n call.hideAttendeeNames = false;\n }\n }\n });\n }\n\n public setSpotlight(\n callId: string,\n spotlightedParticipants: SpotlightedParticipant[],\n maxParticipantsToSpotlight: number\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.spotlight = { ...call.spotlight, spotlightedParticipants, maxParticipantsToSpotlight };\n }\n });\n }\n\n public setTeamsMeetingConference(\n callId: string,\n teamsMeetingConferenceDetails: TeamsMeetingAudioConferencingDetails\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.meetingConference = { conferencePhones: convertConferencePhoneInfo(teamsMeetingConferenceDetails) };\n }\n });\n }\n\n public setParticipantSpotlighted(callId: string, spotlightedParticipant: SpotlightedParticipant): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[toFlatCommunicationIdentifier(spotlightedParticipant.identifier)];\n if (participant) {\n participant.spotlight = { spotlightedOrderPosition: spotlightedParticipant.order };\n } else if (\n call.spotlight &&\n toFlatCommunicationIdentifier(draft.userId) ===\n toFlatCommunicationIdentifier(spotlightedParticipant.identifier)\n ) {\n call.spotlight.localParticipantSpotlight = { spotlightedOrderPosition: spotlightedParticipant.order };\n }\n }\n });\n }\n\n public setParticipantNotSpotlighted(callId: string, spotlightedParticipant: SpotlightedParticipant): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[toFlatCommunicationIdentifier(spotlightedParticipant.identifier)];\n if (participant) {\n participant.spotlight = undefined;\n } else if (\n call.spotlight &&\n toFlatCommunicationIdentifier(draft.userId) ===\n toFlatCommunicationIdentifier(spotlightedParticipant.identifier)\n ) {\n call.spotlight.localParticipantSpotlight = undefined;\n }\n }\n });\n }\n\n /* @conditional-compile-remove(breakout-rooms) */\n public setAssignedBreakoutRoom(callId: string, breakoutRoom?: BreakoutRoom): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.breakoutRooms = { ...call.breakoutRooms, assignedBreakoutRoom: breakoutRoom };\n }\n });\n }\n\n /* @conditional-compile-remove(breakout-rooms) */\n public setBreakoutRoomOriginCallId(callId: string, breakoutRoomCallId: string): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(breakoutRoomCallId)];\n if (call) {\n call.breakoutRooms = { ...call.breakoutRooms, breakoutRoomOriginCallId: callId };\n }\n });\n }\n\n /* @conditional-compile-remove(breakout-rooms) */\n public setBreakoutRoomSettings(callId: string, breakoutRoomSettings: BreakoutRoomsSettings): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.breakoutRooms = { ...call.breakoutRooms, breakoutRoomSettings: breakoutRoomSettings };\n }\n });\n }\n\n /* @conditional-compile-remove(breakout-rooms) */\n public setBreakoutRoomDisplayName(callId: string, breakoutRoomDisplayName: string): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.breakoutRooms = { ...call.breakoutRooms, breakoutRoomDisplayName };\n }\n });\n }\n\n public setCallScreenShareParticipant(callId: string, participantKey: string | undefined): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.screenShareRemoteParticipant = participantKey;\n }\n });\n }\n\n public setLocalVideoStreamRendererView(\n callId: string,\n localVideoMediaStreamType: string,\n view: VideoStreamRendererViewState | undefined\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const localVideoStream = call.localVideoStreams.find(\n (localVideoStream) => localVideoStream.mediaStreamType === localVideoMediaStreamType\n );\n if (localVideoStream) {\n localVideoStream.view = view;\n }\n }\n });\n }\n\n public setParticipantState(callId: string, participantKey: string, state: RemoteParticipantStatus): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.state = state;\n }\n }\n });\n }\n\n public setParticipantIsMuted(callId: string, participantKey: string, muted: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.isMuted = muted;\n }\n }\n });\n }\n\n public setOptimalVideoCount(callId: string, optimalVideoCount: number): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.optimalVideoCount.maxRemoteVideoStreams = optimalVideoCount;\n }\n });\n }\n\n public setParticipantRole(callId: string, participantKey: string, role: ParticipantRole): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.role = role;\n }\n }\n });\n }\n\n public setParticipantDisplayName(callId: string, participantKey: string, displayName: string): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.displayName = displayName;\n }\n }\n });\n }\n\n public setParticipantIsSpeaking(callId: string, participantKey: string, isSpeaking: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.isSpeaking = isSpeaking;\n }\n }\n });\n }\n\n public setParticipantVideoStream(callId: string, participantKey: string, stream: RemoteVideoStreamState): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n // Set is called by subscriber will not modify any rendered stream so if there is existing stream only\n // modify the values that subscriber has access to.\n const existingStream = participant.videoStreams[stream.id];\n if (existingStream) {\n existingStream.isAvailable = stream.isAvailable;\n existingStream.isReceiving = stream.isReceiving;\n existingStream.mediaStreamType = stream.mediaStreamType;\n } else {\n participant.videoStreams[stream.id] = stream;\n }\n }\n }\n });\n }\n\n public setRemoteVideoStreamIsAvailable(\n callId: string,\n participantKey: string,\n streamId: number,\n isAvailable: boolean\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n const stream = participant.videoStreams[streamId];\n if (stream) {\n stream.isAvailable = isAvailable;\n }\n }\n }\n });\n }\n\n public setRemoteVideoStreamIsReceiving(\n callId: string,\n participantKey: string,\n streamId: number,\n isReceiving: boolean\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n const stream = participant.videoStreams[streamId];\n if (stream) {\n stream.isReceiving = isReceiving;\n }\n }\n }\n });\n }\n\n public setRemoteVideoStreamSize(\n callId: string,\n participantKey: string,\n streamId: number,\n size: { width: number; height: number }\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n const stream = participant.videoStreams[streamId];\n if (stream) {\n stream.streamSize = size;\n }\n }\n }\n });\n }\n\n public setRemoteVideoStreams(\n callId: string,\n participantKey: string,\n addRemoteVideoStream: RemoteVideoStreamState[],\n removeRemoteVideoStream: number[]\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n for (const id of removeRemoteVideoStream) {\n delete participant.videoStreams[id];\n }\n\n for (const newStream of addRemoteVideoStream) {\n // This should only be called by the subscriber and some properties are add by other components so if the\n // stream already exists, only update the values that subscriber knows about.\n const stream = participant.videoStreams[newStream.id];\n if (stream) {\n stream.mediaStreamType = newStream.mediaStreamType;\n stream.isAvailable = newStream.isAvailable;\n stream.isReceiving = newStream.isReceiving;\n } else {\n participant.videoStreams[newStream.id] = newStream;\n }\n }\n }\n }\n });\n }\n\n public setRemoteVideoStreamRendererView(\n callId: string,\n participantKey: string,\n streamId: number,\n view: VideoStreamRendererViewState | undefined\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n const stream = participant.videoStreams[streamId];\n if (stream) {\n stream.view = view;\n }\n }\n }\n });\n }\n\n public setRemoteVideoStreamViewScalingMode(\n callId: string,\n participantKey: string,\n streamId: number,\n scalingMode: ScalingMode\n ): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n const stream = participant.videoStreams[streamId];\n if (stream && stream.view) {\n stream.view.scalingMode = scalingMode;\n }\n }\n }\n });\n }\n\n public setIncomingCall(\n call: IncomingCallState | /* @conditional-compile-remove(one-to-n-calling) */ TeamsIncomingCallState\n ): void {\n this.modifyState((draft: CallClientState) => {\n const existingCall = draft.incomingCalls[call.id];\n if (existingCall) {\n existingCall.callerInfo = call.callerInfo;\n } else {\n draft.incomingCalls[call.id] = call;\n }\n });\n }\n\n public removeIncomingCall(callId: string): void {\n this.modifyState((draft: CallClientState) => {\n delete draft.incomingCalls[callId];\n });\n }\n\n public setIncomingCallEnded(callId: string, callEndReason: CallEndReason | undefined): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.incomingCalls[callId];\n if (call) {\n call.endTime = new Date();\n call.callEndReason = callEndReason;\n delete draft.incomingCalls[callId];\n // Performance note: This loop should run only once because the number of entries\n // is never allowed to exceed MAX_CALL_HISTORY_LENGTH. A loop is used for correctness.\n while (Object.keys(draft.incomingCallsEnded).length >= MAX_CALL_HISTORY_LENGTH) {\n delete draft.incomingCallsEnded[findOldestCallEnded(draft.incomingCallsEnded)];\n }\n draft.incomingCallsEnded[callId] = call;\n }\n });\n }\n\n public setDeviceManagerIsSpeakerSelectionAvailable(isSpeakerSelectionAvailable: boolean): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.isSpeakerSelectionAvailable = isSpeakerSelectionAvailable;\n });\n }\n\n public setDeviceManagerSelectedMicrophone(selectedMicrophone?: AudioDeviceInfo): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.selectedMicrophone = selectedMicrophone;\n });\n }\n\n public setDeviceManagerSelectedSpeaker(selectedSpeaker?: AudioDeviceInfo): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.selectedSpeaker = selectedSpeaker;\n });\n }\n\n public setDeviceManagerSelectedCamera(selectedCamera?: VideoDeviceInfo): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.selectedCamera = selectedCamera;\n });\n }\n\n public setDeviceManagerCameras(cameras: VideoDeviceInfo[]): void {\n this.modifyState((draft: CallClientState) => {\n /**\n * SDK initializes cameras with one dummy camera with value { id: 'camera:id', name: '', deviceType: 'USBCamera' } immediately after\n * camera permissions are granted. So selectedCamera will have this value before the actual cameras are obtained. Therefore we should reset\n * selectedCamera to the first camera when there are cameras AND when current selectedCamera does not exist in the new array of cameras *\n */\n if (cameras.length > 0 && !cameras.some((camera) => camera.id === draft.deviceManager.selectedCamera?.id)) {\n draft.deviceManager.selectedCamera = cameras[0];\n }\n draft.deviceManager.cameras = cameras;\n });\n }\n\n public setDeviceManagerMicrophones(microphones: AudioDeviceInfo[]): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.microphones = microphones;\n });\n }\n\n public setDeviceManagerSpeakers(speakers: AudioDeviceInfo[]): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.speakers = speakers;\n });\n }\n\n public setDeviceManagerDeviceAccess(deviceAccess: DeviceAccess): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.deviceAccess = deviceAccess;\n });\n }\n\n public setDeviceManagerUnparentedView(\n localVideoStream: LocalVideoStreamState,\n view: VideoStreamRendererViewState | undefined\n ): void {\n this.modifyState((draft: CallClientState) => {\n draft.deviceManager.unparentedViews.push({\n source: localVideoStream.source,\n mediaStreamType: localVideoStream.mediaStreamType,\n view: view\n });\n });\n }\n\n public deleteDeviceManagerUnparentedView(localVideoStream: LocalVideoStreamState): void {\n this.modifyState((draft: CallClientState) => {\n const foundIndex = draft.deviceManager.unparentedViews.findIndex(\n (stream) => stream.mediaStreamType === localVideoStream.mediaStreamType\n );\n if (foundIndex !== -1) {\n draft.deviceManager.unparentedViews.splice(foundIndex, 1);\n }\n });\n }\n\n public setDeviceManagerUnparentedViewVideoEffects(\n localVideoStream: LocalVideoStreamState,\n videoEffects: LocalVideoStreamVideoEffectsState\n ): void {\n this.modifyState((draft: CallClientState) => {\n const foundIndex = draft.deviceManager.unparentedViews.findIndex(\n (stream) => stream.mediaStreamType === localVideoStream.mediaStreamType\n );\n if (foundIndex !== -1) {\n draft.deviceManager.unparentedViews[foundIndex].videoEffects = videoEffects;\n }\n });\n }\n\n public getAndIncrementAtomicId(): number {\n const id = this._atomicId;\n this._atomicId++;\n return id;\n }\n\n private processNewCaption(captions: CaptionsInfo[], newCaption: CaptionsInfo): void {\n // time stamp when new caption comes in\n newCaption.timestamp = new Date();\n // if this is the first caption, push it in\n if (captions.length === 0) {\n captions.push(newCaption);\n }\n // if the last caption is final, then push the new one in\n else if (captions[captions.length - 1].resultType === 'Final') {\n captions.push(newCaption);\n }\n // if the last caption is Partial, then check if the speaker is the same as the new caption, if so, update the last caption\n else {\n if (\n toFlatCommunicationIdentifier(\n captions[captions.length - 1].speaker.identifier as CommunicationIdentifierKind\n ) === toFlatCommunicationIdentifier(newCaption.speaker.identifier as CommunicationIdentifierKind)\n ) {\n captions[captions.length - 1] = newCaption;\n }\n // if different speaker, ignore the interjector until the current speaker finishes\n // edge case: if we dont receive the final caption from the current speaker for 5 secs, we turn the current speaker caption to final and push in the new interjector\n else {\n if (Date.now() - captions[captions.length - 1].timestamp.getTime() > 5000) {\n captions[captions.length - 1].resultType = 'Final';\n captions.push(newCaption);\n }\n }\n }\n\n // If the array length exceeds 50, remove the oldest caption\n if (captions.length > 50) {\n captions.shift();\n }\n }\n\n public addTeamsCaption(callId: string, caption: TeamsCaptionsInfo): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const currentCaptionLanguage = call.captionsFeature.currentCaptionLanguage;\n if (\n caption.captionLanguage.toUpperCase() === currentCaptionLanguage.toUpperCase() ||\n currentCaptionLanguage === '' ||\n currentCaptionLanguage === undefined\n ) {\n this.processNewCaption(call.captionsFeature.captions, convertFromTeamsSDKToCaptionInfoState(caption));\n }\n }\n });\n }\n\n /* @conditional-compile-remove(acs-close-captions) */\n public addCaption(callId: string, caption: AcsCaptionsInfo): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n this.processNewCaption(call.captionsFeature.captions, convertFromSDKToCaptionInfoState(caption));\n }\n });\n }\n\n /* @conditional-compile-remove(acs-close-captions) */\n public setCaptionsKind(callId: string, kind: CaptionsKind): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.captionsKind = kind;\n }\n });\n }\n\n public clearCaptions(callId: string): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.captions = [];\n }\n });\n }\n\n setIsCaptionActive(callId: string, isCaptionsActive: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.isCaptionsFeatureActive = isCaptionsActive;\n }\n });\n }\n\n setStartCaptionsInProgress(callId: string, startCaptionsInProgress: boolean): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.startCaptionsInProgress = startCaptionsInProgress;\n }\n });\n }\n\n setSelectedSpokenLanguage(callId: string, spokenLanguage: string): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.currentSpokenLanguage = spokenLanguage;\n }\n });\n }\n\n setSelectedCaptionLanguage(callId: string, captionLanguage: string): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.currentCaptionLanguage = captionLanguage;\n }\n });\n }\n\n setAvailableCaptionLanguages(callId: string, captionLanguages: string[]): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.supportedCaptionLanguages = captionLanguages;\n }\n });\n }\n\n setAvailableSpokenLanguages(callId: string, spokenLanguages: string[]): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.supportedSpokenLanguages = spokenLanguages;\n }\n });\n }\n\n setAcceptedTransfer(callId: string, acceptedTransfer: AcceptedTransfer): void {\n this.modifyState((draft: CallClientState) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.transfer.acceptedTransfers[acceptedTransfer.callId] = acceptedTransfer;\n }\n });\n }\n\n /**\n * Tees any errors encountered in an async function to the state.\n *\n * @param action Async function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withAsyncErrorTeedToState<Args extends unknown[], R>(\n action: (...args: Args) => Promise<R>,\n target: CallErrorTarget\n ): (...args: Args) => Promise<R> {\n return async (...args: Args): Promise<R> => {\n try {\n return await action(...args);\n } catch (error) {\n const callError = toCallError(target, error);\n this.setLatestError(target, callError);\n throw callError;\n }\n };\n }\n\n /**\n * Tees any errors encountered in an function to the state.\n *\n * @param action Function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withErrorTeedToState<Args extends unknown[], R>(\n action: (...args: Args) => R,\n target: CallErrorTarget\n ): (...args: Args) => R {\n return (...args: Args): R => {\n try {\n callingStatefulLogger.info(`Calling stateful client target function called: ${target}`);\n return action(...args);\n } catch (error) {\n const callError = toCallError(target, error);\n this.setLatestError(target, callError);\n throw callError;\n }\n };\n }\n\n /**\n * Tees direct errors to state.\n * @remarks\n * This is typically used for errors that are caught and intended to be shown to the user.\n *\n * @param error The raw error to report.\n * @param target The error target to tee error to.\n *\n * @private\n */\n public teeErrorToState = (error: Error, target: CallErrorTarget): void => {\n const callError = toCallError(target, error);\n this.setLatestError(target, callError);\n };\n\n private setLatestError(target: CallErrorTarget, error: CallError): void {\n this.modifyState((draft: CallClientState) => {\n draft.latestErrors[target] = error;\n });\n }\n\n /* @conditional-compile-remove(breakout-rooms) */\n public setLatestNotification(callId: string, notification: CallNotification): void {\n this._latestCallIdsThatPushedNotifications[notification.target] = callId;\n this.modifyState((draft: CallClientState) => {\n draft.latestNotifications[notification.target] = notification;\n });\n }\n\n /* @conditional-compile-remove(breakout-rooms) */\n public deleteLatestNotification(callId: string, notificationTarget: NotificationTarget): void {\n let callIdToPushLatestNotification = this._latestCallIdsThatPushedNotifications[notificationTarget];\n callIdToPushLatestNotification = callIdToPushLatestNotification\n ? this._callIdHistory.latestCallId(callIdToPushLatestNotification)\n : undefined;\n // Only delete the notification if the call that pushed the notification is the same as the call that is trying\n // to delete it.\n if (callIdToPushLatestNotification !== callId) {\n return;\n }\n\n this.modifyState((draft: CallClientState) => {\n delete draft.latestNotifications[notificationTarget];\n });\n }\n}\n\nconst toCallError = (target: CallErrorTarget, error: unknown): CallError => {\n if (error instanceof Error) {\n return new CallError(target, error);\n }\n return new CallError(target, new Error(error as string));\n};\n\nconst findOldestCallEnded = (calls: { [key: string]: { endTime?: Date } }): string => {\n const callEntries = Object.entries(calls);\n let [oldestCallId, oldestCall] = callEntries[0];\n if (oldestCall.endTime === undefined) {\n return oldestCallId;\n }\n for (const [callId, call] of callEntries.slice(1)) {\n if (call.endTime === undefined) {\n return callId;\n }\n if ((call.endTime?.getTime() ?? 0) < (oldestCall.endTime?.getTime() ?? 0)) {\n [oldestCallId, oldestCall] = [callId, call];\n }\n }\n return oldestCallId;\n};\n\nfunction clearParticipantReactionState(callContext: CallContext, callId: string, participantKey: string): void {\n callContext.setReceivedReactionFromParticipant(callId, participantKey, null);\n}\n"]}
@@ -26,8 +26,12 @@ export declare class CallSubscriber {
26
26
  private _spotlightSubscriber;
27
27
  private _breakoutRoomsSubscriber;
28
28
  constructor(call: CallCommon, context: CallContext, internalContext: InternalCallContext);
29
+ private _safeSubscribeInitCaptionSubscriber;
30
+ private _safeSubscribeInitTeamsMeetingConference;
31
+ private _safeSubscribeInitLocalRecordingNotificationSubscriber;
29
32
  private subscribe;
30
33
  unsubscribe: () => void;
34
+ private _safeSubscribe;
31
35
  private addParticipantListener;
32
36
  private removeParticipantListener;
33
37
  private stateChanged;
@@ -27,12 +27,22 @@ import { BreakoutRoomsSubscriber } from './BreakoutRoomsSubscriber';
27
27
  */
28
28
  export class CallSubscriber {
29
29
  constructor(call, context, internalContext) {
30
+ this._safeSubscribeInitCaptionSubscriber = () => {
31
+ this._safeSubscribe(this.initCaptionSubscriber);
32
+ };
33
+ this._safeSubscribeInitTeamsMeetingConference = () => {
34
+ this._safeSubscribe(this.initTeamsMeetingConference);
35
+ };
36
+ /* @conditional-compile-remove(local-recording-notification) */
37
+ this._safeSubscribeInitLocalRecordingNotificationSubscriber = () => {
38
+ this._safeSubscribe(this.initLocalRecordingNotificationSubscriber);
39
+ };
30
40
  this.subscribe = () => {
31
41
  this._call.on('stateChanged', this.stateChanged);
32
- this._call.on('stateChanged', this.initCaptionSubscriber);
33
- this._call.on('stateChanged', this.initTeamsMeetingConference);
42
+ this._call.on('stateChanged', this._safeSubscribeInitCaptionSubscriber);
43
+ this._call.on('stateChanged', this._safeSubscribeInitTeamsMeetingConference);
34
44
  /* @conditional-compile-remove(local-recording-notification) */
35
- this._call.on('stateChanged', this.initLocalRecordingNotificationSubscriber);
45
+ this._call.on('stateChanged', this._safeSubscribeInitLocalRecordingNotificationSubscriber);
36
46
  this._call.on('idChanged', this.idChanged);
37
47
  this._call.on('isScreenSharingOnChanged', this.isScreenSharingOnChanged);
38
48
  this._call.on('remoteParticipantsUpdated', this.remoteParticipantsUpdated);
@@ -57,10 +67,10 @@ export class CallSubscriber {
57
67
  this.unsubscribe = () => {
58
68
  var _a, _b, _c, _d;
59
69
  this._call.off('stateChanged', this.stateChanged);
60
- this._call.off('stateChanged', this.initCaptionSubscriber);
70
+ this._call.off('stateChanged', this._safeSubscribeInitCaptionSubscriber);
71
+ this._call.off('stateChanged', this._safeSubscribeInitTeamsMeetingConference);
61
72
  /* @conditional-compile-remove(local-recording-notification) */
62
- this._call.off('stateChanged', this.initLocalRecordingNotificationSubscriber);
63
- this._call.off('stateChanged', this.initTeamsMeetingConference);
73
+ this._call.off('stateChanged', this._safeSubscribeInitLocalRecordingNotificationSubscriber);
64
74
  this._call.off('idChanged', this.idChanged);
65
75
  this._call.off('isScreenSharingOnChanged', this.isScreenSharingOnChanged);
66
76
  this._call.off('remoteParticipantsUpdated', this.remoteParticipantsUpdated);
@@ -104,7 +114,7 @@ export class CallSubscriber {
104
114
  // subscribe to captions here so that we don't call captions when call is not initialized
105
115
  if (this._call.state === 'Connected' && !this._CaptionsFeatureSubscriber) {
106
116
  this._CaptionsFeatureSubscriber = new CaptionsFeatureSubscriber(this._callIdRef, this._context, this._call.feature(Features.Captions));
107
- this._call.off('stateChanged', this.initCaptionSubscriber);
117
+ this._call.off('stateChanged', this._safeSubscribeInitCaptionSubscriber);
108
118
  }
109
119
  };
110
120
  this.initTeamsMeetingConference = () => {
@@ -115,7 +125,7 @@ export class CallSubscriber {
115
125
  .then((teamsMeetingConferenceDetails) => {
116
126
  this._context.setTeamsMeetingConference(this._callIdRef.callId, teamsMeetingConferenceDetails);
117
127
  });
118
- this._call.off('stateChanged', this.initTeamsMeetingConference);
128
+ this._call.off('stateChanged', this._safeSubscribeInitTeamsMeetingConference);
119
129
  }
120
130
  };
121
131
  /* @conditional-compile-remove(local-recording-notification) */
@@ -124,7 +134,7 @@ export class CallSubscriber {
124
134
  // Will throw an error if not in interop scenarios
125
135
  if (this._call.state === 'Connected' && this._call.kind === 'TeamsCall' && !this._localRecordingSubscriber) {
126
136
  this._localRecordingSubscriber = new LocalRecordingSubscriber(this._callIdRef, this._context, this._call.feature(Features.LocalRecording));
127
- this._call.off('stateChanged', this.initLocalRecordingNotificationSubscriber);
137
+ this._call.off('stateChanged', this._safeSubscribeInitLocalRecordingNotificationSubscriber);
128
138
  }
129
139
  };
130
140
  this.idChanged = () => {
@@ -218,6 +228,18 @@ export class CallSubscriber {
218
228
  this._breakoutRoomsSubscriber = new BreakoutRoomsSubscriber(this._callIdRef, this._context, this._call.feature(Features.BreakoutRooms));
219
229
  this.subscribe();
220
230
  }
231
+ // This is a helper function to safely call subscriber functions. This is needed in order to prevent events
232
+ // with the same event type from failing to fire due to a subscriber throwing an error upon subscription.
233
+ // Wrap your listeners with this helper function if your listener can fail due to initialization or fail
234
+ // during a function call. This will prevent other events using the same event type from failing to fire.
235
+ _safeSubscribe(subscriber) {
236
+ try {
237
+ subscriber();
238
+ }
239
+ catch (e) {
240
+ this._context.teeErrorToState(e, 'Call.on');
241
+ }
242
+ }
221
243
  addParticipantListener(participant) {
222
244
  var _a;
223
245
  const participantKey = toFlatCommunicationIdentifier(participant.identifier);