@azure/communication-react 1.20.0-alpha-202410030015 → 1.20.0-alpha-202410050015
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/communication-react.d.ts +67 -1
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BfMoXn7s.js → ChatMessageComponentAsRichTextEditBox-Bc2rnHE3.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BfMoXn7s.js.map → ChatMessageComponentAsRichTextEditBox-Bc2rnHE3.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DoRv_d64.js → RichTextSendBoxWrapper-BhEvRpXU.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DoRv_d64.js.map → RichTextSendBoxWrapper-BhEvRpXU.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-BcfT9uWf.js → index-CM02z9d2.js} +585 -412
- package/dist/dist-cjs/communication-react/index-CM02z9d2.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +3 -1
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/dataConversion.js +5 -1
- package/dist/dist-esm/acs-ui-common/src/dataConversion.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/acs-ui-javascript-loaders/src/callCompositeLoader.js +1 -1
- package/dist/dist-esm/acs-ui-javascript-loaders/src/callCompositeLoader.js.map +1 -1
- package/dist/dist-esm/acs-ui-javascript-loaders/src/callWithChatCompositeLoader.js +1 -1
- package/dist/dist-esm/acs-ui-javascript-loaders/src/callWithChatCompositeLoader.js.map +1 -1
- package/dist/dist-esm/acs-ui-javascript-loaders/src/chatCompositeLoader.js +1 -1
- package/dist/dist-esm/acs-ui-javascript-loaders/src/chatCompositeLoader.js.map +1 -1
- package/dist/dist-esm/acs-ui-javascript-loaders/src/outboundCallCompositeLoader.js +1 -1
- package/dist/dist-esm/acs-ui-javascript-loaders/src/outboundCallCompositeLoader.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +3 -3
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js +1 -1
- package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/getRemoteParticipantsExcludingConsumers.js +2 -1
- package/dist/dist-esm/calling-component-bindings/src/getRemoteParticipantsExcludingConsumers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +2 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js +2 -2
- package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +46 -0
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +3 -0
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js +57 -12
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +1 -0
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +6 -0
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.js +2 -0
- package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js +49 -43
- package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +2 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StreamUtils.d.ts +2 -1
- package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TogetherModeSubscriber.d.ts +19 -0
- package/dist/dist-esm/calling-stateful-client/src/TogetherModeSubscriber.js +32 -0
- package/dist/dist-esm/calling-stateful-client/src/TogetherModeSubscriber.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/UserFacingDiagnosticsSubscriber.js +1 -1
- package/dist/dist-esm/calling-stateful-client/src/UserFacingDiagnosticsSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +2 -0
- package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +1 -1
- package/dist/dist-esm/communication-react/src/index.js +1 -1
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/HorizontalGallery.js +2 -1
- package/dist/dist-esm/react-components/src/components/HorizontalGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/LocalVideoTile.js +1 -1
- package/dist/dist-esm/react-components/src/components/LocalVideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Notification.js +1 -1
- package/dist/dist-esm/react-components/src/components/Notification.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VerticalGallery.js +2 -1
- package/dist/dist-esm/react-components/src/components/VerticalGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/index.d.ts +1 -0
- package/dist/dist-esm/react-components/src/index.js +1 -0
- package/dist/dist-esm/react-components/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/cy-GB/ComponentLocale.d.ts +8 -0
- package/dist/dist-esm/react-components/src/localization/locales/cy-GB/ComponentLocale.js +13 -0
- package/dist/dist-esm/react-components/src/localization/locales/cy-GB/ComponentLocale.js.map +1 -0
- package/dist/dist-esm/react-components/src/localization/locales/cy-GB/strings.json +670 -0
- package/dist/dist-esm/react-components/src/theming/generateTheme.js +10 -2
- package/dist/dist-esm/react-components/src/theming/generateTheme.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +13 -9
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +4 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +15 -14
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.d.ts +0 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +28 -21
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +11 -7
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +7 -8
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +7 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js +5 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js +7 -6
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js +4 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js +6 -7
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js +5 -5
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +3 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +15 -10
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js +7 -9
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +20 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +19 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +33 -36
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.d.ts +6 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.js +11 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.d.ts +16 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js +15 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js +4 -5
- package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.d.ts +3 -0
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +4 -7
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +2 -0
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +9 -4
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/index.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/index.js +1 -0
- package/dist/dist-esm/react-composites/src/composites/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/cy-GB/CompositeLocale.d.ts +8 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/cy-GB/CompositeLocale.js +15 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/cy-GB/CompositeLocale.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/cy-GB/strings.json +411 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +1 -0
- package/package.json +5 -5
- package/dist/dist-cjs/communication-react/index-BcfT9uWf.js.map +0 -1
@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,EACb,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAC3C,CAAC;QAEF,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IA6GD,2GAA2G;IAC3G,yGAAyG;IACzG,wGAAwG;IACxG,yGAAyG;IACjG,cAAc,CAAC,UAAsB;QAC3C,IAAI,CAAC;YACH,UAAU,EAAE,CAAC;QACf,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAU,EAAE,SAAS,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IAEO,sBAAsB,CAAC,WAA8B;;QAC3D,MAAM,cAAc,GAAG,6BAA6B,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7E,MAAA,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,0CAAE,WAAW,EAAE,CAAC;QAChE,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAC9B,cAAc,EACd,IAAI,qBAAqB,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAC9F,CAAC;IACJ,CAAC;IAEO,yBAAyB,CAAC,WAA8B;QAC9D,MAAM,cAAc,GAAG,6BAA6B,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7E,MAAM,qBAAqB,GAAG,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC/E,IAAI,qBAAqB,EAAE,CAAC;YAC1B,qBAAqB,CAAC,WAAW,EAAE,CAAC;YACpC,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;CA0JF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Features, LocalVideoStream, RemoteParticipant } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { CallCommon } from './BetaToStableTypes';\nimport { CallContext } from './CallContext';\nimport { CallIdRef } from './CallIdRef';\nimport { CaptionsFeatureSubscriber } from './CaptionsSubscriber';\nimport {\n convertSdkLocalStreamToDeclarativeLocalStream,\n convertSdkParticipantToDeclarativeParticipant\n} from './Converter';\nimport { InternalCallContext } from './InternalCallContext';\n\nimport { LocalVideoStreamVideoEffectsSubscriber } from './LocalVideoStreamVideoEffectsSubscriber';\nimport { ParticipantSubscriber } from './ParticipantSubscriber';\nimport { RecordingSubscriber } from './RecordingSubscriber';\nimport { PPTLiveSubscriber } from './PPTLiveSubscriber';\nimport { disposeView } from './StreamUtils';\nimport { TranscriptionSubscriber } from './TranscriptionSubscriber';\nimport { UserFacingDiagnosticsSubscriber } from './UserFacingDiagnosticsSubscriber';\nimport { RaiseHandSubscriber } from './RaiseHandSubscriber';\nimport { OptimalVideoCountSubscriber } from './OptimalVideoCountSubscriber';\n\nimport { CapabilitiesSubscriber } from './CapabilitiesSubscriber';\nimport { ReactionSubscriber } from './ReactionSubscriber';\nimport { SpotlightSubscriber } from './SpotlightSubscriber';\n/* @conditional-compile-remove(local-recording-notification) */\nimport { LocalRecordingSubscriber } from './LocalRecordingSubscriber';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { BreakoutRoomsSubscriber } from './BreakoutRoomsSubscriber';\n\n/**\n * Keeps track of the listeners assigned to a particular call because when we get an event from SDK, it doesn't tell us\n * which call it is for. If we keep track of this then we know which call in the state that needs an update and also\n * which property of that call. Also we can use this when unregistering to a call.\n */\nexport class CallSubscriber {\n private _call: CallCommon;\n private _callIdRef: CallIdRef;\n private _context: CallContext;\n private _internalContext: InternalCallContext;\n\n private _diagnosticsSubscriber: UserFacingDiagnosticsSubscriber;\n private _participantSubscribers: Map<string, ParticipantSubscriber>;\n private _recordingSubscriber: RecordingSubscriber;\n private _transcriptionSubscriber: TranscriptionSubscriber;\n /* @conditional-compile-remove(local-recording-notification) */\n private _localRecordingSubscriber?: LocalRecordingSubscriber;\n private _pptLiveSubscriber: PPTLiveSubscriber;\n private _optimalVideoCountSubscriber: OptimalVideoCountSubscriber;\n private _CaptionsFeatureSubscriber?: CaptionsFeatureSubscriber;\n private _raiseHandSubscriber?: RaiseHandSubscriber;\n private _reactionSubscriber?: ReactionSubscriber;\n\n private _localVideoStreamVideoEffectsSubscribers: Map<string, LocalVideoStreamVideoEffectsSubscriber>;\n\n private _capabilitiesSubscriber: CapabilitiesSubscriber;\n private _spotlightSubscriber: SpotlightSubscriber;\n /* @conditional-compile-remove(breakout-rooms) */\n private _breakoutRoomsSubscriber: BreakoutRoomsSubscriber;\n\n constructor(call: CallCommon, context: CallContext, internalContext: InternalCallContext) {\n this._call = call;\n this._callIdRef = { callId: call.id };\n this._context = context;\n this._internalContext = internalContext;\n\n this._diagnosticsSubscriber = new UserFacingDiagnosticsSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.UserFacingDiagnostics)\n );\n this._participantSubscribers = new Map<string, ParticipantSubscriber>();\n this._recordingSubscriber = new RecordingSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Recording)\n );\n this._pptLiveSubscriber = new PPTLiveSubscriber(this._callIdRef, this._context, this._call);\n this._transcriptionSubscriber = new TranscriptionSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Transcription)\n );\n this._raiseHandSubscriber = new RaiseHandSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.RaiseHand)\n );\n this._reactionSubscriber = new ReactionSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Reaction)\n );\n this._optimalVideoCountSubscriber = new OptimalVideoCountSubscriber({\n callIdRef: this._callIdRef,\n context: this._context,\n localOptimalVideoCountFeature: this._call.feature(Features.OptimalVideoCount)\n });\n\n this._localVideoStreamVideoEffectsSubscribers = new Map();\n\n this._capabilitiesSubscriber = new CapabilitiesSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Capabilities)\n );\n\n this._spotlightSubscriber = new SpotlightSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Spotlight)\n );\n /* @conditional-compile-remove(breakout-rooms) */\n this._breakoutRoomsSubscriber = new BreakoutRoomsSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.BreakoutRooms)\n );\n\n this.subscribe();\n }\n\n private _safeSubscribeInitCaptionSubscriber = (): void => {\n this._safeSubscribe(this.initCaptionSubscriber);\n };\n\n private _safeSubscribeInitTeamsMeetingConference = (): void => {\n this._safeSubscribe(this.initTeamsMeetingConference);\n };\n\n /* @conditional-compile-remove(local-recording-notification) */\n private _safeSubscribeInitLocalRecordingNotificationSubscriber = (): void => {\n this._safeSubscribe(this.initLocalRecordingNotificationSubscriber);\n };\n\n private subscribe = (): void => {\n this._call.on('stateChanged', this.stateChanged);\n this._call.on('stateChanged', this._safeSubscribeInitCaptionSubscriber);\n this._call.on('stateChanged', this._safeSubscribeInitTeamsMeetingConference);\n /* @conditional-compile-remove(local-recording-notification) */\n this._call.on('stateChanged', this._safeSubscribeInitLocalRecordingNotificationSubscriber);\n this._call.on('idChanged', this.idChanged);\n this._call.on('isScreenSharingOnChanged', this.isScreenSharingOnChanged);\n this._call.on('remoteParticipantsUpdated', this.remoteParticipantsUpdated);\n this._call.on('localVideoStreamsUpdated', this.localVideoStreamsUpdated);\n this._call.on('isMutedChanged', this.isMuteChanged);\n this._call.on('roleChanged', this.callRoleChangedHandler);\n this._call.feature(Features.DominantSpeakers).on('dominantSpeakersChanged', this.dominantSpeakersChanged);\n /* @conditional-compile-remove(total-participant-count) */\n this._call.on('totalParticipantCountChanged', this.totalParticipantCountChangedHandler);\n /* @conditional-compile-remove(soft-mute) */\n this._call.on('mutedByOthers', this.mutedByOthersHandler);\n\n for (const localVideoStream of this._call.localVideoStreams) {\n this._internalContext.setLocalRenderInfo(\n this._callIdRef.callId,\n localVideoStream.mediaStreamType,\n localVideoStream,\n 'NotRendered',\n undefined\n );\n }\n\n if (this._call.remoteParticipants.length > 0) {\n this._call.remoteParticipants.forEach((participant: RemoteParticipant) => {\n this.addParticipantListener(participant);\n });\n\n this._context.setCallRemoteParticipants(\n this._callIdRef.callId,\n this._call.remoteParticipants.map(convertSdkParticipantToDeclarativeParticipant),\n []\n );\n }\n };\n\n public unsubscribe = (): void => {\n this._call.off('stateChanged', this.stateChanged);\n this._call.off('stateChanged', this._safeSubscribeInitCaptionSubscriber);\n this._call.off('stateChanged', this._safeSubscribeInitTeamsMeetingConference);\n /* @conditional-compile-remove(local-recording-notification) */\n this._call.off('stateChanged', this._safeSubscribeInitLocalRecordingNotificationSubscriber);\n this._call.off('idChanged', this.idChanged);\n this._call.off('isScreenSharingOnChanged', this.isScreenSharingOnChanged);\n this._call.off('remoteParticipantsUpdated', this.remoteParticipantsUpdated);\n this._call.off('localVideoStreamsUpdated', this.localVideoStreamsUpdated);\n this._call.off('isMutedChanged', this.isMuteChanged);\n this._call.off('roleChanged', this.callRoleChangedHandler);\n /* @conditional-compile-remove(total-participant-count) */\n this._call.off('totalParticipantCountChanged', this.totalParticipantCountChangedHandler);\n /* @conditional-compile-remove(soft-mute) */\n this._call.off('mutedByOthers', this.mutedByOthersHandler);\n\n this._participantSubscribers.forEach((participantSubscriber: ParticipantSubscriber) => {\n participantSubscriber.unsubscribe();\n });\n this._participantSubscribers.clear();\n\n // If we are unsubscribing that means we no longer want to display any video for this call (callEnded or callAgent\n // disposed) and we should not be updating it any more. So if video is rendering we stop rendering.\n for (const localVideoStream of this._call.localVideoStreams) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n disposeView(\n this._context,\n this._internalContext,\n this._callIdRef.callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localVideoStream)\n );\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId, mediaStreamType);\n }\n\n this._diagnosticsSubscriber.unsubscribe();\n this._recordingSubscriber.unsubscribe();\n this._transcriptionSubscriber.unsubscribe();\n /* @conditional-compile-remove(local-recording-notification) */\n this._localRecordingSubscriber?.unsubscribe();\n this._optimalVideoCountSubscriber.unsubscribe();\n this._pptLiveSubscriber.unsubscribe();\n this._CaptionsFeatureSubscriber?.unsubscribe();\n this._raiseHandSubscriber?.unsubscribe();\n\n this._capabilitiesSubscriber.unsubscribe();\n this._reactionSubscriber?.unsubscribe();\n this._spotlightSubscriber.unsubscribe();\n /* @conditional-compile-remove(breakout-rooms) */\n this._breakoutRoomsSubscriber.unsubscribe();\n };\n\n // This is a helper function to safely call subscriber functions. This is needed in order to prevent events\n // with the same event type from failing to fire due to a subscriber throwing an error upon subscription.\n // Wrap your listeners with this helper function if your listener can fail due to initialization or fail\n // during a function call. This will prevent other events using the same event type from failing to fire.\n private _safeSubscribe(subscriber: () => void): void {\n try {\n subscriber();\n } catch (e) {\n this._context.teeErrorToState(e as Error, 'Call.on');\n }\n }\n\n private addParticipantListener(participant: RemoteParticipant): void {\n const participantKey = toFlatCommunicationIdentifier(participant.identifier);\n this._participantSubscribers.get(participantKey)?.unsubscribe();\n this._participantSubscribers.set(\n participantKey,\n new ParticipantSubscriber(this._callIdRef, participant, this._context, this._internalContext)\n );\n }\n\n private removeParticipantListener(participant: RemoteParticipant): void {\n const participantKey = toFlatCommunicationIdentifier(participant.identifier);\n const participantSubscriber = this._participantSubscribers.get(participantKey);\n if (participantSubscriber) {\n participantSubscriber.unsubscribe();\n this._participantSubscribers.delete(participantKey);\n }\n }\n\n private stateChanged = (): void => {\n this._context.setCallState(this._callIdRef.callId, this._call.state);\n };\n\n private initCaptionSubscriber = (): void => {\n // subscribe to captions here so that we don't call captions when call is not initialized\n if (this._call.state === 'Connected' && !this._CaptionsFeatureSubscriber) {\n this._CaptionsFeatureSubscriber = new CaptionsFeatureSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Captions)\n );\n this._call.off('stateChanged', this._safeSubscribeInitCaptionSubscriber);\n }\n };\n\n private initTeamsMeetingConference = (): void => {\n if (this._call.state === 'Connected') {\n this._call\n .feature(Features.TeamsMeetingAudioConferencing)\n .getTeamsMeetingAudioConferencingDetails()\n .then((teamsMeetingConferenceDetails) => {\n this._context.setTeamsMeetingConference(this._callIdRef.callId, teamsMeetingConferenceDetails);\n });\n this._call.off('stateChanged', this._safeSubscribeInitTeamsMeetingConference);\n }\n };\n\n /* @conditional-compile-remove(local-recording-notification) */\n private initLocalRecordingNotificationSubscriber = (): void => {\n // Subscribe to LocalRecordingFeature as it is only available in interop scenarios\n // Will throw an error if not in interop scenarios\n if (this._call.state === 'Connected' && this._call.kind === 'TeamsCall' && !this._localRecordingSubscriber) {\n this._localRecordingSubscriber = new LocalRecordingSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.LocalRecording)\n );\n this._call.off('stateChanged', this._safeSubscribeInitLocalRecordingNotificationSubscriber);\n }\n };\n\n private idChanged = (): void => {\n this._internalContext.setCallId(this._call.id, this._callIdRef.callId);\n this._context.setCallId(this._call.id, this._callIdRef.callId);\n this._callIdRef.callId = this._call.id;\n };\n\n private isScreenSharingOnChanged = (): void => {\n this._context.setCallIsScreenSharingOn(this._callIdRef.callId, this._call.isScreenSharingOn);\n };\n\n private isMuteChanged = (): void => {\n this._context.setCallIsMicrophoneMuted(this._callIdRef.callId, this._call.isMuted);\n };\n\n private callRoleChangedHandler = (): void => {\n this._context.setRole(this._callIdRef.callId, this._call.role);\n };\n\n /* @conditional-compile-remove(total-participant-count) */\n private totalParticipantCountChangedHandler = (): void => {\n this._context.setTotalParticipantCount(this._callIdRef.callId, this._call.totalParticipantCount);\n };\n\n // TODO: Tee to notification state once available\n /* @conditional-compile-remove(soft-mute) */\n private mutedByOthersHandler = (): void => {\n this._context.teeErrorToState(\n { name: 'mutedByOthers', message: 'Muted by another participant' },\n 'Call.mutedByOthers'\n );\n };\n\n private remoteParticipantsUpdated = (event: { added: RemoteParticipant[]; removed: RemoteParticipant[] }): void => {\n event.added.forEach((participant: RemoteParticipant) => {\n this.addParticipantListener(participant);\n });\n event.removed.forEach((participant: RemoteParticipant) => {\n this.removeParticipantListener(participant);\n });\n\n // Remove any added participants from remoteParticipantsEnded if they are there and add any removed participants to\n // remoteParticipantsEnded.\n this._context.setCallRemoteParticipantsEnded(\n this._callIdRef.callId,\n event.removed.map(convertSdkParticipantToDeclarativeParticipant),\n event.added.map((participant: RemoteParticipant) => {\n return toFlatCommunicationIdentifier(participant.identifier);\n })\n );\n\n // Add added participants to remoteParticipants and remove removed participants from remoteParticipants.\n this._context.setCallRemoteParticipants(\n this._callIdRef.callId,\n event.added.map(convertSdkParticipantToDeclarativeParticipant),\n event.removed.map((participant: RemoteParticipant) => {\n return toFlatCommunicationIdentifier(participant.identifier);\n })\n );\n };\n\n private localVideoStreamsUpdated = (event: { added: LocalVideoStream[]; removed: LocalVideoStream[] }): void => {\n for (const localVideoStream of event.added) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n // IMPORTANT: The internalContext should be set before context. This is done to ensure that the internal context\n // has the required data when component re-renders due to external state changes.\n this._internalContext.setLocalRenderInfo(\n this._callIdRef.callId,\n mediaStreamType,\n localVideoStream,\n 'NotRendered',\n undefined\n );\n\n // Subscribe to video effect changes\n this._localVideoStreamVideoEffectsSubscribers.get(mediaStreamType)?.unsubscribe();\n this._localVideoStreamVideoEffectsSubscribers.set(\n mediaStreamType,\n new LocalVideoStreamVideoEffectsSubscriber({\n parent: this._callIdRef,\n context: this._context,\n localVideoStream: localVideoStream,\n localVideoStreamEffectsAPI: localVideoStream.feature(Features.VideoEffects)\n })\n );\n }\n for (const localVideoStream of event.removed) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n this._localVideoStreamVideoEffectsSubscribers.get(mediaStreamType)?.unsubscribe();\n disposeView(\n this._context,\n this._internalContext,\n this._callIdRef.callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localVideoStream)\n );\n\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId, mediaStreamType);\n }\n\n this._context.setCallLocalVideoStream(\n this._callIdRef.callId,\n event.added.map(convertSdkLocalStreamToDeclarativeLocalStream),\n event.removed.map(convertSdkLocalStreamToDeclarativeLocalStream)\n );\n };\n\n private dominantSpeakersChanged = (): void => {\n const dominantSpeakers = this._call.feature(Features.DominantSpeakers).dominantSpeakers;\n this._context.setCallDominantSpeakers(this._callIdRef.callId, dominantSpeakers);\n };\n}\n"]}
|
1
|
+
{"version":3,"file":"CallSubscriber.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/CallSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,QAAQ,EAAuC,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAIxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EACL,6CAA6C,EAC7C,6CAA6C,EAC9C,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,sCAAsC,EAAE,MAAM,0CAA0C,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,+DAA+D;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BA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AgB,CAAC,CAC9F,CAAC;IACJ,CAAC;IAEO,yBAAyB,CAAC,WAA8B;QAC9D,MAAM,cAAc,GAAG,6BAA6B,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7E,MAAM,qBAAqB,GAAG,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC/E,IAAI,qBAAqB,EAAE,CAAC;YAC1B,qBAAqB,CAAC,WAAW,EAAE,CAAC;YACpC,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;CA0JF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Features, LocalVideoStream, RemoteParticipant } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { CallCommon } from './BetaToStableTypes';\nimport { CallContext } from './CallContext';\nimport { CallIdRef } from './CallIdRef';\nimport { CaptionsFeatureSubscriber } from './CaptionsSubscriber';\nimport {\n convertSdkLocalStreamToDeclarativeLocalStream,\n convertSdkParticipantToDeclarativeParticipant\n} from './Converter';\nimport { InternalCallContext } from './InternalCallContext';\n\nimport { LocalVideoStreamVideoEffectsSubscriber } from './LocalVideoStreamVideoEffectsSubscriber';\nimport { ParticipantSubscriber } from './ParticipantSubscriber';\nimport { RecordingSubscriber } from './RecordingSubscriber';\nimport { PPTLiveSubscriber } from './PPTLiveSubscriber';\nimport { disposeView } from './StreamUtils';\nimport { TranscriptionSubscriber } from './TranscriptionSubscriber';\nimport { UserFacingDiagnosticsSubscriber } from './UserFacingDiagnosticsSubscriber';\nimport { RaiseHandSubscriber } from './RaiseHandSubscriber';\nimport { OptimalVideoCountSubscriber } from './OptimalVideoCountSubscriber';\n\nimport { CapabilitiesSubscriber } from './CapabilitiesSubscriber';\nimport { ReactionSubscriber } from './ReactionSubscriber';\nimport { SpotlightSubscriber } from './SpotlightSubscriber';\n/* @conditional-compile-remove(local-recording-notification) */\nimport { LocalRecordingSubscriber } from './LocalRecordingSubscriber';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { BreakoutRoomsSubscriber } from './BreakoutRoomsSubscriber';\n/* @conditional-compile-remove(together-mode) */\nimport { TogetherModeSubscriber } from './TogetherModeSubscriber';\n\n/**\n * Keeps track of the listeners assigned to a particular call because when we get an event from SDK, it doesn't tell us\n * which call it is for. If we keep track of this then we know which call in the state that needs an update and also\n * which property of that call. Also we can use this when unregistering to a call.\n */\nexport class CallSubscriber {\n private _call: CallCommon;\n private _callIdRef: CallIdRef;\n private _context: CallContext;\n private _internalContext: InternalCallContext;\n\n private _diagnosticsSubscriber: UserFacingDiagnosticsSubscriber;\n private _participantSubscribers: Map<string, ParticipantSubscriber>;\n private _recordingSubscriber: RecordingSubscriber;\n private _transcriptionSubscriber: TranscriptionSubscriber;\n /* @conditional-compile-remove(local-recording-notification) */\n private _localRecordingSubscriber?: LocalRecordingSubscriber;\n private _pptLiveSubscriber: PPTLiveSubscriber;\n private _optimalVideoCountSubscriber: OptimalVideoCountSubscriber;\n private _CaptionsFeatureSubscriber?: CaptionsFeatureSubscriber;\n private _raiseHandSubscriber?: RaiseHandSubscriber;\n private _reactionSubscriber?: ReactionSubscriber;\n\n private _localVideoStreamVideoEffectsSubscribers: Map<string, LocalVideoStreamVideoEffectsSubscriber>;\n\n private _capabilitiesSubscriber: CapabilitiesSubscriber;\n private _spotlightSubscriber: SpotlightSubscriber;\n /* @conditional-compile-remove(breakout-rooms) */\n private _breakoutRoomsSubscriber: BreakoutRoomsSubscriber;\n /* @conditional-compile-remove(together-mode) */\n private _togetherModeSubscriber: TogetherModeSubscriber;\n\n constructor(call: CallCommon, context: CallContext, internalContext: InternalCallContext) {\n this._call = call;\n this._callIdRef = { callId: call.id };\n this._context = context;\n this._internalContext = internalContext;\n\n this._diagnosticsSubscriber = new UserFacingDiagnosticsSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.UserFacingDiagnostics)\n );\n this._participantSubscribers = new Map<string, ParticipantSubscriber>();\n this._recordingSubscriber = new RecordingSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Recording)\n );\n this._pptLiveSubscriber = new PPTLiveSubscriber(this._callIdRef, this._context, this._call);\n this._transcriptionSubscriber = new TranscriptionSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Transcription)\n );\n this._raiseHandSubscriber = new RaiseHandSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.RaiseHand)\n );\n this._reactionSubscriber = new ReactionSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Reaction)\n );\n this._optimalVideoCountSubscriber = new OptimalVideoCountSubscriber({\n callIdRef: this._callIdRef,\n context: this._context,\n localOptimalVideoCountFeature: this._call.feature(Features.OptimalVideoCount)\n });\n\n this._localVideoStreamVideoEffectsSubscribers = new Map();\n\n this._capabilitiesSubscriber = new CapabilitiesSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Capabilities)\n );\n\n this._spotlightSubscriber = new SpotlightSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Spotlight)\n );\n /* @conditional-compile-remove(breakout-rooms) */\n this._breakoutRoomsSubscriber = new BreakoutRoomsSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.BreakoutRooms)\n );\n /* @conditional-compile-remove(together-mode) */\n this._togetherModeSubscriber = new TogetherModeSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.TogetherMode)\n );\n\n this.subscribe();\n }\n\n private _safeSubscribeInitCaptionSubscriber = (): void => {\n this._safeSubscribe(this.initCaptionSubscriber);\n };\n\n private _safeSubscribeInitTeamsMeetingConference = (): void => {\n this._safeSubscribe(this.initTeamsMeetingConference);\n };\n\n /* @conditional-compile-remove(local-recording-notification) */\n private _safeSubscribeInitLocalRecordingNotificationSubscriber = (): void => {\n this._safeSubscribe(this.initLocalRecordingNotificationSubscriber);\n };\n\n private subscribe = (): void => {\n this._call.on('stateChanged', this.stateChanged);\n this._call.on('stateChanged', this._safeSubscribeInitCaptionSubscriber);\n this._call.on('stateChanged', this._safeSubscribeInitTeamsMeetingConference);\n /* @conditional-compile-remove(local-recording-notification) */\n this._call.on('stateChanged', this._safeSubscribeInitLocalRecordingNotificationSubscriber);\n this._call.on('idChanged', this.idChanged);\n this._call.on('isScreenSharingOnChanged', this.isScreenSharingOnChanged);\n this._call.on('remoteParticipantsUpdated', this.remoteParticipantsUpdated);\n this._call.on('localVideoStreamsUpdated', this.localVideoStreamsUpdated);\n this._call.on('isMutedChanged', this.isMuteChanged);\n this._call.on('roleChanged', this.callRoleChangedHandler);\n this._call.feature(Features.DominantSpeakers).on('dominantSpeakersChanged', this.dominantSpeakersChanged);\n /* @conditional-compile-remove(total-participant-count) */\n this._call.on('totalParticipantCountChanged', this.totalParticipantCountChangedHandler);\n /* @conditional-compile-remove(soft-mute) */\n this._call.on('mutedByOthers', this.mutedByOthersHandler);\n\n for (const localVideoStream of this._call.localVideoStreams) {\n this._internalContext.setLocalRenderInfo(\n this._callIdRef.callId,\n localVideoStream.mediaStreamType,\n localVideoStream,\n 'NotRendered',\n undefined\n );\n }\n\n if (this._call.remoteParticipants.length > 0) {\n this._call.remoteParticipants.forEach((participant: RemoteParticipant) => {\n this.addParticipantListener(participant);\n });\n\n this._context.setCallRemoteParticipants(\n this._callIdRef.callId,\n this._call.remoteParticipants.map(convertSdkParticipantToDeclarativeParticipant),\n []\n );\n }\n };\n\n public unsubscribe = (): void => {\n this._call.off('stateChanged', this.stateChanged);\n this._call.off('stateChanged', this._safeSubscribeInitCaptionSubscriber);\n this._call.off('stateChanged', this._safeSubscribeInitTeamsMeetingConference);\n /* @conditional-compile-remove(local-recording-notification) */\n this._call.off('stateChanged', this._safeSubscribeInitLocalRecordingNotificationSubscriber);\n this._call.off('idChanged', this.idChanged);\n this._call.off('isScreenSharingOnChanged', this.isScreenSharingOnChanged);\n this._call.off('remoteParticipantsUpdated', this.remoteParticipantsUpdated);\n this._call.off('localVideoStreamsUpdated', this.localVideoStreamsUpdated);\n this._call.off('isMutedChanged', this.isMuteChanged);\n this._call.off('roleChanged', this.callRoleChangedHandler);\n /* @conditional-compile-remove(total-participant-count) */\n this._call.off('totalParticipantCountChanged', this.totalParticipantCountChangedHandler);\n /* @conditional-compile-remove(soft-mute) */\n this._call.off('mutedByOthers', this.mutedByOthersHandler);\n\n this._participantSubscribers.forEach((participantSubscriber: ParticipantSubscriber) => {\n participantSubscriber.unsubscribe();\n });\n this._participantSubscribers.clear();\n\n // If we are unsubscribing that means we no longer want to display any video for this call (callEnded or callAgent\n // disposed) and we should not be updating it any more. So if video is rendering we stop rendering.\n for (const localVideoStream of this._call.localVideoStreams) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n disposeView(\n this._context,\n this._internalContext,\n this._callIdRef.callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localVideoStream)\n );\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId, mediaStreamType);\n }\n\n this._diagnosticsSubscriber.unsubscribe();\n this._recordingSubscriber.unsubscribe();\n this._transcriptionSubscriber.unsubscribe();\n /* @conditional-compile-remove(local-recording-notification) */\n this._localRecordingSubscriber?.unsubscribe();\n this._optimalVideoCountSubscriber.unsubscribe();\n this._pptLiveSubscriber.unsubscribe();\n this._CaptionsFeatureSubscriber?.unsubscribe();\n this._raiseHandSubscriber?.unsubscribe();\n\n this._capabilitiesSubscriber.unsubscribe();\n this._reactionSubscriber?.unsubscribe();\n this._spotlightSubscriber.unsubscribe();\n /* @conditional-compile-remove(breakout-rooms) */\n this._breakoutRoomsSubscriber.unsubscribe();\n /* @conditional-compile-remove(together-mode) */\n this._togetherModeSubscriber.unsubscribe();\n };\n\n // This is a helper function to safely call subscriber functions. This is needed in order to prevent events\n // with the same event type from failing to fire due to a subscriber throwing an error upon subscription.\n // Wrap your listeners with this helper function if your listener can fail due to initialization or fail\n // during a function call. This will prevent other events using the same event type from failing to fire.\n private _safeSubscribe(subscriber: () => void): void {\n try {\n subscriber();\n } catch (e) {\n this._context.teeErrorToState(e as Error, 'Call.on');\n }\n }\n\n private addParticipantListener(participant: RemoteParticipant): void {\n const participantKey = toFlatCommunicationIdentifier(participant.identifier);\n this._participantSubscribers.get(participantKey)?.unsubscribe();\n this._participantSubscribers.set(\n participantKey,\n new ParticipantSubscriber(this._callIdRef, participant, this._context, this._internalContext)\n );\n }\n\n private removeParticipantListener(participant: RemoteParticipant): void {\n const participantKey = toFlatCommunicationIdentifier(participant.identifier);\n const participantSubscriber = this._participantSubscribers.get(participantKey);\n if (participantSubscriber) {\n participantSubscriber.unsubscribe();\n this._participantSubscribers.delete(participantKey);\n }\n }\n\n private stateChanged = (): void => {\n this._context.setCallState(this._callIdRef.callId, this._call.state);\n };\n\n private initCaptionSubscriber = (): void => {\n // subscribe to captions here so that we don't call captions when call is not initialized\n if (this._call.state === 'Connected' && !this._CaptionsFeatureSubscriber) {\n this._CaptionsFeatureSubscriber = new CaptionsFeatureSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Captions)\n );\n this._call.off('stateChanged', this._safeSubscribeInitCaptionSubscriber);\n }\n };\n\n private initTeamsMeetingConference = (): void => {\n if (this._call.state === 'Connected') {\n this._call\n .feature(Features.TeamsMeetingAudioConferencing)\n .getTeamsMeetingAudioConferencingDetails()\n .then((teamsMeetingConferenceDetails) => {\n this._context.setTeamsMeetingConference(this._callIdRef.callId, teamsMeetingConferenceDetails);\n });\n this._call.off('stateChanged', this._safeSubscribeInitTeamsMeetingConference);\n }\n };\n\n /* @conditional-compile-remove(local-recording-notification) */\n private initLocalRecordingNotificationSubscriber = (): void => {\n // Subscribe to LocalRecordingFeature as it is only available in interop scenarios\n // Will throw an error if not in interop scenarios\n if (this._call.state === 'Connected' && this._call.kind === 'TeamsCall' && !this._localRecordingSubscriber) {\n this._localRecordingSubscriber = new LocalRecordingSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.LocalRecording)\n );\n this._call.off('stateChanged', this._safeSubscribeInitLocalRecordingNotificationSubscriber);\n }\n };\n\n private idChanged = (): void => {\n this._internalContext.setCallId(this._call.id, this._callIdRef.callId);\n this._context.setCallId(this._call.id, this._callIdRef.callId);\n this._callIdRef.callId = this._call.id;\n };\n\n private isScreenSharingOnChanged = (): void => {\n this._context.setCallIsScreenSharingOn(this._callIdRef.callId, this._call.isScreenSharingOn);\n };\n\n private isMuteChanged = (): void => {\n this._context.setCallIsMicrophoneMuted(this._callIdRef.callId, this._call.isMuted);\n };\n\n private callRoleChangedHandler = (): void => {\n this._context.setRole(this._callIdRef.callId, this._call.role);\n };\n\n /* @conditional-compile-remove(total-participant-count) */\n private totalParticipantCountChangedHandler = (): void => {\n this._context.setTotalParticipantCount(this._callIdRef.callId, this._call.totalParticipantCount);\n };\n\n // TODO: Tee to notification state once available\n /* @conditional-compile-remove(soft-mute) */\n private mutedByOthersHandler = (): void => {\n this._context.teeErrorToState(\n { name: 'mutedByOthers', message: 'Muted by another participant' },\n 'Call.mutedByOthers'\n );\n };\n\n private remoteParticipantsUpdated = (event: { added: RemoteParticipant[]; removed: RemoteParticipant[] }): void => {\n event.added.forEach((participant: RemoteParticipant) => {\n this.addParticipantListener(participant);\n });\n event.removed.forEach((participant: RemoteParticipant) => {\n this.removeParticipantListener(participant);\n });\n\n // Remove any added participants from remoteParticipantsEnded if they are there and add any removed participants to\n // remoteParticipantsEnded.\n this._context.setCallRemoteParticipantsEnded(\n this._callIdRef.callId,\n event.removed.map(convertSdkParticipantToDeclarativeParticipant),\n event.added.map((participant: RemoteParticipant) => {\n return toFlatCommunicationIdentifier(participant.identifier);\n })\n );\n\n // Add added participants to remoteParticipants and remove removed participants from remoteParticipants.\n this._context.setCallRemoteParticipants(\n this._callIdRef.callId,\n event.added.map(convertSdkParticipantToDeclarativeParticipant),\n event.removed.map((participant: RemoteParticipant) => {\n return toFlatCommunicationIdentifier(participant.identifier);\n })\n );\n };\n\n private localVideoStreamsUpdated = (event: { added: LocalVideoStream[]; removed: LocalVideoStream[] }): void => {\n for (const localVideoStream of event.added) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n // IMPORTANT: The internalContext should be set before context. This is done to ensure that the internal context\n // has the required data when component re-renders due to external state changes.\n this._internalContext.setLocalRenderInfo(\n this._callIdRef.callId,\n mediaStreamType,\n localVideoStream,\n 'NotRendered',\n undefined\n );\n\n // Subscribe to video effect changes\n this._localVideoStreamVideoEffectsSubscribers.get(mediaStreamType)?.unsubscribe();\n this._localVideoStreamVideoEffectsSubscribers.set(\n mediaStreamType,\n new LocalVideoStreamVideoEffectsSubscriber({\n parent: this._callIdRef,\n context: this._context,\n localVideoStream: localVideoStream,\n localVideoStreamEffectsAPI: localVideoStream.feature(Features.VideoEffects)\n })\n );\n }\n for (const localVideoStream of event.removed) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n this._localVideoStreamVideoEffectsSubscribers.get(mediaStreamType)?.unsubscribe();\n disposeView(\n this._context,\n this._internalContext,\n this._callIdRef.callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localVideoStream)\n );\n\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId, mediaStreamType);\n }\n\n this._context.setCallLocalVideoStream(\n this._callIdRef.callId,\n event.added.map(convertSdkLocalStreamToDeclarativeLocalStream),\n event.removed.map(convertSdkLocalStreamToDeclarativeLocalStream)\n );\n };\n\n private dominantSpeakersChanged = (): void => {\n const dominantSpeakers = this._call.feature(Features.DominantSpeakers).dominantSpeakers;\n this._context.setCallDominantSpeakers(this._callIdRef.callId, dominantSpeakers);\n };\n}\n"]}
|
@@ -101,6 +101,8 @@ export function convertSdkCallToDeclarativeCall(call) {
|
|
101
101
|
localRecording: { isLocalRecordingActive: false },
|
102
102
|
pptLive: { isActive: false },
|
103
103
|
raiseHand: { raisedHands: [] },
|
104
|
+
/* @conditional-compile-remove(together-mode) */
|
105
|
+
togetherMode: { stream: [] },
|
104
106
|
localParticipantReaction: undefined,
|
105
107
|
transcription: { isTranscriptionActive: false },
|
106
108
|
screenShareRemoteParticipant: undefined,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Converter.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/Converter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAmBlC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAYxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,qDAAqD;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAUxD;;GAEG;AACH,MAAM,UAAU,6CAA6C,CAC3D,MAA2B;IAE3B,MAAM,0BAA0B,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAEzE,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,IAAI,EAAE,SAAS;QAEf,YAAY,EAAE,kDAAkD,CAAC,0BAA0B,CAAC,aAAa,CAAC;KAC3G,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,+CAA+C,CAC7D,MAA4B;IAE5B,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,MAAM,CAAC,IAAI;KACxB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,6CAA6C,CAC3D,WAAiC;IAEjC,MAAM,uBAAuB,GAAoD,EAAE,CAAC;IACpF,KAAK,MAAM,WAAW,IAAI,WAAW,CAAC,YAAY,EAAE,CAAC;QACnD,uBAAuB,CAAC,WAAW,CAAC,EA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AE,KAAK;SAClB,CAAC;QACF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,MAAA,MAAA,WAAW,CAAC,eAAe,0CAAE,WAAW,mCAAI,EAAE,CAAC;QAClE,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAC3C,QAAQ,CAAC,WAAW,GAAG,MAAA,MAAA,WAAW,CAAC,mBAAmB,0CAAE,WAAW,mCAAI,EAAE,CAAC;QAC1E,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC;QAE3B,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n RemoteParticipant as SdkRemoteParticipant,\n RemoteVideoStream as SdkRemoteVideoStream,\n LocalVideoStream as SdkLocalVideoStream,\n VideoStreamRendererView,\n IncomingCall,\n IncomingCallCommon\n} from '@azure/communication-calling';\nimport { TeamsIncomingCall } from '@azure/communication-calling';\nimport { TeamsCaptionsInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { CaptionsInfo as AcsCaptionsInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { CallKind } from '@azure/communication-calling';\nimport { TeamsCallInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(calling-beta-sdk) */\nimport { CallInfo } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n CallState,\n RemoteParticipantState as DeclarativeRemoteParticipant,\n RemoteVideoStreamState as DeclarativeRemoteVideoStream,\n LocalVideoStreamState as DeclarativeLocalVideoStream,\n IncomingCallState as DeclarativeIncomingCall,\n VideoStreamRendererViewState as DeclarativeVideoStreamRendererView,\n CallInfoState\n} from './CallClientState';\nimport { CaptionsInfo } from './CallClientState';\nimport { TeamsIncomingCallState as DeclarativeTeamsIncomingCall } from './CallClientState';\nimport { _isTeamsIncomingCall } from './TypeGuards';\nimport { _isACSCall } from './TypeGuards';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { _isTeamsCall } from './TypeGuards';\nimport { CallCommon } from './BetaToStableTypes';\n\nimport { Features } from '@azure/communication-calling';\n\nimport { VideoEffectName } from '@azure/communication-calling';\n\nimport { LocalVideoStreamVideoEffectsState } from './CallClientState';\nimport { RaisedHand } from '@azure/communication-calling';\nimport { RaisedHandState } from './CallClientState';\nimport { TeamsMeetingAudioConferencingDetails } from '@azure/communication-calling';\nimport { ConferencePhoneInfo } from './CallClientState';\n\n/**\n * @private\n */\nexport function convertSdkLocalStreamToDeclarativeLocalStream(\n stream: SdkLocalVideoStream\n): DeclarativeLocalVideoStream {\n const localVideoStreamEffectsAPI = stream.feature(Features.VideoEffects);\n\n return {\n source: stream.source,\n mediaStreamType: stream.mediaStreamType,\n view: undefined,\n\n videoEffects: convertFromSDKToDeclarativeVideoStreamVideoEffects(localVideoStreamEffectsAPI.activeEffects)\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkRemoteStreamToDeclarativeRemoteStream(\n stream: SdkRemoteVideoStream\n): DeclarativeRemoteVideoStream {\n return {\n id: stream.id,\n mediaStreamType: stream.mediaStreamType,\n isAvailable: stream.isAvailable,\n isReceiving: stream.isReceiving,\n view: undefined,\n streamSize: stream.size\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkParticipantToDeclarativeParticipant(\n participant: SdkRemoteParticipant\n): DeclarativeRemoteParticipant {\n const declarativeVideoStreams: { [key: number]: DeclarativeRemoteVideoStream } = {};\n for (const videoStream of participant.videoStreams) {\n declarativeVideoStreams[videoStream.id] = convertSdkRemoteStreamToDeclarativeRemoteStream(videoStream);\n }\n return {\n identifier: participant.identifier,\n displayName: participant.displayName,\n state: participant.state,\n callEndReason: participant.callEndReason,\n videoStreams: declarativeVideoStreams,\n isMuted: participant.isMuted,\n isSpeaking: participant.isSpeaking,\n raisedHand: undefined,\n role: participant.role,\n spotlight: undefined\n };\n}\n\n/**\n * @private\n *\n * Note at the time of writing only one LocalVideoStream is supported by the SDK.\n */\nexport function convertSdkCallToDeclarativeCall(call: CallCommon): CallState {\n const declarativeRemoteParticipants: { [key: string]: DeclarativeRemoteParticipant } = {};\n call.remoteParticipants.forEach((participant: SdkRemoteParticipant) => {\n declarativeRemoteParticipants[toFlatCommunicationIdentifier(participant.identifier)] =\n convertSdkParticipantToDeclarativeParticipant(participant);\n });\n let hideAttendeeNames = false;\n if (\n call.feature(Features.Capabilities).capabilities &&\n call.feature(Features.Capabilities).capabilities.viewAttendeeNames\n ) {\n const viewAttendeeNames = call.feature(Features.Capabilities).capabilities.viewAttendeeNames;\n if (!viewAttendeeNames.isPresent && viewAttendeeNames.reason === 'MeetingRestricted') {\n hideAttendeeNames = true;\n }\n }\n\n let callInfo: TeamsCallInfo | undefined | /* @conditional-compile-remove(calling-beta-sdk) */ CallInfo;\n if ('info' in call) {\n callInfo = call.info as TeamsCallInfo | undefined | /* @conditional-compile-remove(calling-beta-sdk) */ CallInfo;\n }\n\n return {\n id: call.id,\n /* @conditional-compile-remove(teams-identity-support) */\n kind: _isACSCall(call) ? ('Call' as CallKind) : ('TeamsCall' as CallKind),\n callerInfo: call.callerInfo,\n state: call.state,\n callEndReason: call.callEndReason,\n diagnostics: {\n network: {\n latest: {}\n },\n media: {\n latest: {}\n }\n },\n direction: call.direction,\n isMuted: call.isMuted,\n isScreenSharingOn: call.isScreenSharingOn,\n localVideoStreams: call.localVideoStreams.map(convertSdkLocalStreamToDeclarativeLocalStream),\n remoteParticipants: declarativeRemoteParticipants,\n remoteParticipantsEnded: {},\n recording: { isRecordingActive: false },\n /* @conditional-compile-remove(local-recording-notification) */\n localRecording: { isLocalRecordingActive: false },\n pptLive: { isActive: false },\n raiseHand: { raisedHands: [] },\n localParticipantReaction: undefined,\n transcription: { isTranscriptionActive: false },\n screenShareRemoteParticipant: undefined,\n startTime: new Date(),\n endTime: undefined,\n role: call.role,\n captionsFeature: {\n captions: [],\n supportedSpokenLanguages: [],\n supportedCaptionLanguages: [],\n currentCaptionLanguage: '',\n currentSpokenLanguage: '',\n isCaptionsFeatureActive: false,\n startCaptionsInProgress: false,\n /* @conditional-compile-remove(acs-close-captions) */\n captionsKind: _isTeamsCall(call) ? 'TeamsCaptions' : 'Captions'\n },\n transfer: {\n acceptedTransfers: {}\n },\n optimalVideoCount: {\n maxRemoteVideoStreams: call.feature(Features.OptimalVideoCount).optimalVideoCount\n },\n hideAttendeeNames,\n info: callInfo,\n meetingConference: { conferencePhones: [] }\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkIncomingCallToDeclarativeIncomingCall(\n call: IncomingCallCommon\n): DeclarativeIncomingCall | DeclarativeTeamsIncomingCall {\n if (_isTeamsIncomingCall(call)) {\n const newInfo: CallInfoState = { ...(call as TeamsIncomingCall).info, kind: call.kind };\n return {\n id: call.id,\n info: newInfo,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n } else {\n const newInfo: CallInfoState = { ...(call as IncomingCall).info, kind: call.kind };\n return {\n id: call.id,\n info: newInfo,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n }\n const newInfo: CallInfoState = { ...(call as IncomingCall).info, kind: call.kind };\n return {\n id: call.id,\n info: newInfo,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n}\n\n/**\n * @private\n */\nexport function convertFromSDKToDeclarativeVideoStreamRendererView(\n view: VideoStreamRendererView\n): DeclarativeVideoStreamRendererView {\n return {\n scalingMode: view.scalingMode,\n isMirrored: view.isMirrored,\n target: view.target\n };\n}\n\n/**\n * @private\n */\nexport function convertFromTeamsSDKToCaptionInfoState(caption: TeamsCaptionsInfo): CaptionsInfo {\n return {\n ...caption\n };\n}\n\n/* @conditional-compile-remove(acs-close-captions) */\n/**\n * @private\n */\nexport function convertFromSDKToCaptionInfoState(caption: AcsCaptionsInfo): CaptionsInfo {\n return {\n captionText: caption.spokenText,\n ...caption\n };\n}\n\n/** @private */\nexport function convertFromSDKToDeclarativeVideoStreamVideoEffects(\n videoEffects: VideoEffectName[]\n): LocalVideoStreamVideoEffectsState {\n return {\n activeEffects: videoEffects\n };\n}\n\n/**\n * @private\n */\nexport function convertFromSDKToRaisedHandState(raisedHand: RaisedHand): RaisedHandState {\n return {\n raisedHandOrderPosition: raisedHand.order\n };\n}\n\n/** @private */\nexport function convertConferencePhoneInfo(\n meetingConferencePhoneInfo?: TeamsMeetingAudioConferencingDetails\n): ConferencePhoneInfo[] {\n if (!meetingConferencePhoneInfo) {\n return [];\n }\n\n return meetingConferencePhoneInfo.phoneNumbers.flatMap((phoneNumber) => {\n const common = {\n conferenceId: meetingConferencePhoneInfo.phoneConferenceId,\n country: phoneNumber.countryName,\n city: phoneNumber.cityName,\n phoneNumber: '',\n isTollFree: false\n };\n const toll = Object.assign({}, common);\n toll.phoneNumber = phoneNumber.tollPhoneNumber?.phoneNumber ?? '';\n toll.isTollFree = false;\n\n const tollFree = Object.assign({}, common);\n tollFree.phoneNumber = phoneNumber.tollFreePhoneNumber?.phoneNumber ?? '';\n tollFree.isTollFree = true;\n\n return [toll, tollFree].filter((phoneInfo) => phoneInfo.phoneNumber);\n });\n}\n"]}
|
1
|
+
{"version":3,"file":"Converter.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/Converter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAmBlC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAYxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,qDAAqD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G,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAC3C,QAAQ,CAAC,WAAW,GAAG,MAAA,MAAA,WAAW,CAAC,mBAAmB,0CAAE,WAAW,mCAAI,EAAE,CAAC;QAC1E,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC;QAE3B,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n RemoteParticipant as SdkRemoteParticipant,\n RemoteVideoStream as SdkRemoteVideoStream,\n LocalVideoStream as SdkLocalVideoStream,\n VideoStreamRendererView,\n IncomingCall,\n IncomingCallCommon\n} from '@azure/communication-calling';\nimport { TeamsIncomingCall } from '@azure/communication-calling';\nimport { TeamsCaptionsInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { CaptionsInfo as AcsCaptionsInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { CallKind } from '@azure/communication-calling';\nimport { TeamsCallInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(calling-beta-sdk) */\nimport { CallInfo } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n CallState,\n RemoteParticipantState as DeclarativeRemoteParticipant,\n RemoteVideoStreamState as DeclarativeRemoteVideoStream,\n LocalVideoStreamState as DeclarativeLocalVideoStream,\n IncomingCallState as DeclarativeIncomingCall,\n VideoStreamRendererViewState as DeclarativeVideoStreamRendererView,\n CallInfoState\n} from './CallClientState';\nimport { CaptionsInfo } from './CallClientState';\nimport { TeamsIncomingCallState as DeclarativeTeamsIncomingCall } from './CallClientState';\nimport { _isTeamsIncomingCall } from './TypeGuards';\nimport { _isACSCall } from './TypeGuards';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { _isTeamsCall } from './TypeGuards';\nimport { CallCommon } from './BetaToStableTypes';\n\nimport { Features } from '@azure/communication-calling';\n\nimport { VideoEffectName } from '@azure/communication-calling';\n\nimport { LocalVideoStreamVideoEffectsState } from './CallClientState';\nimport { RaisedHand } from '@azure/communication-calling';\nimport { RaisedHandState } from './CallClientState';\nimport { TeamsMeetingAudioConferencingDetails } from '@azure/communication-calling';\nimport { ConferencePhoneInfo } from './CallClientState';\n\n/**\n * @private\n */\nexport function convertSdkLocalStreamToDeclarativeLocalStream(\n stream: SdkLocalVideoStream\n): DeclarativeLocalVideoStream {\n const localVideoStreamEffectsAPI = stream.feature(Features.VideoEffects);\n\n return {\n source: stream.source,\n mediaStreamType: stream.mediaStreamType,\n view: undefined,\n\n videoEffects: convertFromSDKToDeclarativeVideoStreamVideoEffects(localVideoStreamEffectsAPI.activeEffects)\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkRemoteStreamToDeclarativeRemoteStream(\n stream: SdkRemoteVideoStream\n): DeclarativeRemoteVideoStream {\n return {\n id: stream.id,\n mediaStreamType: stream.mediaStreamType,\n isAvailable: stream.isAvailable,\n isReceiving: stream.isReceiving,\n view: undefined,\n streamSize: stream.size\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkParticipantToDeclarativeParticipant(\n participant: SdkRemoteParticipant\n): DeclarativeRemoteParticipant {\n const declarativeVideoStreams: { [key: number]: DeclarativeRemoteVideoStream } = {};\n for (const videoStream of participant.videoStreams) {\n declarativeVideoStreams[videoStream.id] = convertSdkRemoteStreamToDeclarativeRemoteStream(videoStream);\n }\n return {\n identifier: participant.identifier,\n displayName: participant.displayName,\n state: participant.state,\n callEndReason: participant.callEndReason,\n videoStreams: declarativeVideoStreams,\n isMuted: participant.isMuted,\n isSpeaking: participant.isSpeaking,\n raisedHand: undefined,\n role: participant.role,\n spotlight: undefined\n };\n}\n\n/**\n * @private\n *\n * Note at the time of writing only one LocalVideoStream is supported by the SDK.\n */\nexport function convertSdkCallToDeclarativeCall(call: CallCommon): CallState {\n const declarativeRemoteParticipants: { [key: string]: DeclarativeRemoteParticipant } = {};\n call.remoteParticipants.forEach((participant: SdkRemoteParticipant) => {\n declarativeRemoteParticipants[toFlatCommunicationIdentifier(participant.identifier)] =\n convertSdkParticipantToDeclarativeParticipant(participant);\n });\n let hideAttendeeNames = false;\n if (\n call.feature(Features.Capabilities).capabilities &&\n call.feature(Features.Capabilities).capabilities.viewAttendeeNames\n ) {\n const viewAttendeeNames = call.feature(Features.Capabilities).capabilities.viewAttendeeNames;\n if (!viewAttendeeNames.isPresent && viewAttendeeNames.reason === 'MeetingRestricted') {\n hideAttendeeNames = true;\n }\n }\n\n let callInfo: TeamsCallInfo | undefined | /* @conditional-compile-remove(calling-beta-sdk) */ CallInfo;\n if ('info' in call) {\n callInfo = call.info as TeamsCallInfo | undefined | /* @conditional-compile-remove(calling-beta-sdk) */ CallInfo;\n }\n\n return {\n id: call.id,\n /* @conditional-compile-remove(teams-identity-support) */\n kind: _isACSCall(call) ? ('Call' as CallKind) : ('TeamsCall' as CallKind),\n callerInfo: call.callerInfo,\n state: call.state,\n callEndReason: call.callEndReason,\n diagnostics: {\n network: {\n latest: {}\n },\n media: {\n latest: {}\n }\n },\n direction: call.direction,\n isMuted: call.isMuted,\n isScreenSharingOn: call.isScreenSharingOn,\n localVideoStreams: call.localVideoStreams.map(convertSdkLocalStreamToDeclarativeLocalStream),\n remoteParticipants: declarativeRemoteParticipants,\n remoteParticipantsEnded: {},\n recording: { isRecordingActive: false },\n /* @conditional-compile-remove(local-recording-notification) */\n localRecording: { isLocalRecordingActive: false },\n pptLive: { isActive: false },\n raiseHand: { raisedHands: [] },\n /* @conditional-compile-remove(together-mode) */\n togetherMode: { stream: [] },\n localParticipantReaction: undefined,\n transcription: { isTranscriptionActive: false },\n screenShareRemoteParticipant: undefined,\n startTime: new Date(),\n endTime: undefined,\n role: call.role,\n captionsFeature: {\n captions: [],\n supportedSpokenLanguages: [],\n supportedCaptionLanguages: [],\n currentCaptionLanguage: '',\n currentSpokenLanguage: '',\n isCaptionsFeatureActive: false,\n startCaptionsInProgress: false,\n /* @conditional-compile-remove(acs-close-captions) */\n captionsKind: _isTeamsCall(call) ? 'TeamsCaptions' : 'Captions'\n },\n transfer: {\n acceptedTransfers: {}\n },\n optimalVideoCount: {\n maxRemoteVideoStreams: call.feature(Features.OptimalVideoCount).optimalVideoCount\n },\n hideAttendeeNames,\n info: callInfo,\n meetingConference: { conferencePhones: [] }\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkIncomingCallToDeclarativeIncomingCall(\n call: IncomingCallCommon\n): DeclarativeIncomingCall | DeclarativeTeamsIncomingCall {\n if (_isTeamsIncomingCall(call)) {\n const newInfo: CallInfoState = { ...(call as TeamsIncomingCall).info, kind: call.kind };\n return {\n id: call.id,\n info: newInfo,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n } else {\n const newInfo: CallInfoState = { ...(call as IncomingCall).info, kind: call.kind };\n return {\n id: call.id,\n info: newInfo,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n }\n const newInfo: CallInfoState = { ...(call as IncomingCall).info, kind: call.kind };\n return {\n id: call.id,\n info: newInfo,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n}\n\n/**\n * @private\n */\nexport function convertFromSDKToDeclarativeVideoStreamRendererView(\n view: VideoStreamRendererView\n): DeclarativeVideoStreamRendererView {\n return {\n scalingMode: view.scalingMode,\n isMirrored: view.isMirrored,\n target: view.target\n };\n}\n\n/**\n * @private\n */\nexport function convertFromTeamsSDKToCaptionInfoState(caption: TeamsCaptionsInfo): CaptionsInfo {\n return {\n ...caption\n };\n}\n\n/* @conditional-compile-remove(acs-close-captions) */\n/**\n * @private\n */\nexport function convertFromSDKToCaptionInfoState(caption: AcsCaptionsInfo): CaptionsInfo {\n return {\n captionText: caption.spokenText,\n ...caption\n };\n}\n\n/** @private */\nexport function convertFromSDKToDeclarativeVideoStreamVideoEffects(\n videoEffects: VideoEffectName[]\n): LocalVideoStreamVideoEffectsState {\n return {\n activeEffects: videoEffects\n };\n}\n\n/**\n * @private\n */\nexport function convertFromSDKToRaisedHandState(raisedHand: RaisedHand): RaisedHandState {\n return {\n raisedHandOrderPosition: raisedHand.order\n };\n}\n\n/** @private */\nexport function convertConferencePhoneInfo(\n meetingConferencePhoneInfo?: TeamsMeetingAudioConferencingDetails\n): ConferencePhoneInfo[] {\n if (!meetingConferencePhoneInfo) {\n return [];\n }\n\n return meetingConferencePhoneInfo.phoneNumbers.flatMap((phoneNumber) => {\n const common = {\n conferenceId: meetingConferencePhoneInfo.phoneConferenceId,\n country: phoneNumber.countryName,\n city: phoneNumber.cityName,\n phoneNumber: '',\n isTollFree: false\n };\n const toll = Object.assign({}, common);\n toll.phoneNumber = phoneNumber.tollPhoneNumber?.phoneNumber ?? '';\n toll.isTollFree = false;\n\n const tollFree = Object.assign({}, common);\n tollFree.phoneNumber = phoneNumber.tollFreePhoneNumber?.phoneNumber ?? '';\n tollFree.isTollFree = true;\n\n return [toll, tollFree].filter((phoneInfo) => phoneInfo.phoneNumber);\n });\n}\n"]}
|
@@ -32,22 +32,24 @@ class ProxyDeviceManager {
|
|
32
32
|
this._deviceManager.on('selectedMicrophoneChanged', this.selectedMicrophoneChanged);
|
33
33
|
this._deviceManager.on('selectedSpeakerChanged', this.selectedSpeakerChanged);
|
34
34
|
// Subscribe to browser camera permissions changes
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
35
|
+
if (navigator.permissions) {
|
36
|
+
try {
|
37
|
+
navigator.permissions.query({ name: 'camera' }).then((cameraPermissions) => {
|
38
|
+
cameraPermissions.addEventListener('change', this.permissionsApiStateChangeHandler);
|
39
|
+
});
|
40
|
+
}
|
41
|
+
catch (e) {
|
42
|
+
console.info('Could not subscribe to Permissions API Camera changed events, API is not supported by browser', e);
|
43
|
+
}
|
44
|
+
// Subscribe to browser microphone permissions changes
|
45
|
+
try {
|
46
|
+
navigator.permissions.query({ name: 'microphone' }).then((micPermissions) => {
|
47
|
+
micPermissions.addEventListener('change', this.permissionsApiStateChangeHandler);
|
48
|
+
});
|
49
|
+
}
|
50
|
+
catch (e) {
|
51
|
+
console.info('Could not subscribe to Permissions API Microphone changed events, API is not supported by browser', e);
|
52
|
+
}
|
51
53
|
}
|
52
54
|
};
|
53
55
|
/**
|
@@ -58,23 +60,25 @@ class ProxyDeviceManager {
|
|
58
60
|
this._deviceManager.off('audioDevicesUpdated', this.audioDevicesUpdated);
|
59
61
|
this._deviceManager.off('selectedMicrophoneChanged', this.selectedMicrophoneChanged);
|
60
62
|
this._deviceManager.off('selectedSpeakerChanged', this.selectedSpeakerChanged);
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
63
|
+
if (navigator.permissions) {
|
64
|
+
// Unsubscribe from browser camera permissions changes
|
65
|
+
try {
|
66
|
+
navigator.permissions.query({ name: 'camera' }).then((cameraPermissions) => {
|
67
|
+
cameraPermissions.removeEventListener('change', this.permissionsApiStateChangeHandler);
|
68
|
+
});
|
69
|
+
}
|
70
|
+
catch (e) {
|
71
|
+
console.info('Could not Unsubscribe to Permissions API Camera changed events, API is not supported by browser', e);
|
72
|
+
}
|
73
|
+
// Unsubscribe from browser microphone permissions changes
|
74
|
+
try {
|
75
|
+
navigator.permissions.query({ name: 'microphone' }).then((micPermissions) => {
|
76
|
+
micPermissions.removeEventListener('change', this.permissionsApiStateChangeHandler);
|
77
|
+
});
|
78
|
+
}
|
79
|
+
catch (e) {
|
80
|
+
console.info('Could not Unsubscribe to Permissions API Camera changed events, API is not supported by browser', e);
|
81
|
+
}
|
78
82
|
}
|
79
83
|
};
|
80
84
|
this.permissionsApiStateChangeHandler = () => __awaiter(this, void 0, void 0, function* () {
|
@@ -115,16 +119,18 @@ class ProxyDeviceManager {
|
|
115
119
|
// information about the device permission state, but is not supported yet in Firefox or Android WebView.
|
116
120
|
// Note: It also has the limitation where it cannot detect if the device is blocked by the Operating System
|
117
121
|
// permissions.
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
122
|
+
if (navigator.permissions) {
|
123
|
+
try {
|
124
|
+
const [cameraPermissions, micPermissions] = yield Promise.all([
|
125
|
+
navigator.permissions.query({ name: 'camera' }),
|
126
|
+
navigator.permissions.query({ name: 'microphone' })
|
127
|
+
]);
|
128
|
+
hasCameraPermission = cameraPermissions.state === 'granted';
|
129
|
+
hasMicPermission = micPermissions.state === 'granted';
|
130
|
+
}
|
131
|
+
catch (e) {
|
132
|
+
console.info('Permissions API is not supported by browser', e);
|
133
|
+
}
|
128
134
|
}
|
129
135
|
this._context.setDeviceManagerDeviceAccess({
|
130
136
|
video: hasCameraPermission,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DeviceManagerDeclarative.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/DeviceManagerDeclarative.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AA+BlC;;;;;;GAMG;AACH,MAAM,kBAAkB;IAItB,YAAY,aAA4B,EAAE,OAAoB;QAQtD,qBAAgB,GAAG,GAAS,EAAE;YACpC,mHAAmH;YACnH,4GAA4G;YAC5G,mDAAmD;YACnD,IAAI,CAAC,QAAQ,CAAC,2CAA2C,CAAC,IAAI,CAAC,cAAc,CAAC,2BAA2B,CAAC,CAAC;YAC3G,IAAI,CAAC,QAAQ,CAAC,kCAAkC,CAAC,IAAI,CAAC,cAAc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C5E,CAAC,CAAC;IACH,OAAO,IAAI,KAAK,CAAC,aAAa,EAAE,kBAAkB,CAA0B,CAAC;AAC/E,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AudioDeviceInfo, DeviceAccess, DeviceManager, VideoDeviceInfo } from '@azure/communication-calling';\nimport { CallContext } from './CallContext';\nimport { InternalCallContext } from './InternalCallContext';\n\nimport { LocalVideoStream } from '@azure/communication-calling';\n\n/**\n * Defines the additional methods added by the stateful on top of {@link @azure/communication-calling#DeviceManager}.\n *\n * @public\n */\nexport interface StatefulDeviceManager extends DeviceManager {\n /**\n * Sets the selectedCamera in the {@link DeviceManagerState}. This is completely developer driven and is not tied in\n * any way to {@link @azure/communication-calling#DeviceManager}. It is entirely contained in\n * {@link StatefulDeviceManager}. See also {@link DeviceManagerState.selectedCamera}.\n */\n selectCamera: (device: VideoDeviceInfo) => void;\n\n /**\n * Gets the list of unparented video streams. This is a list of video streams that have not been added to a\n * {@link @azure/communication-calling#Call}. This is useful for developers who want to interact with rendered\n * video streams before they have started a call. See also {@link @azure/communication-react#CallClient.createView}.\n *\n * @public\n */\n getUnparentedVideoStreams: () => LocalVideoStream[];\n}\n\n/**\n * ProxyDeviceManager proxies DeviceManager and subscribes to all events that affect device manager state. State updates\n * are set on the provided context. Also any queries for state are proxied and stored in state as well. Only one device\n * manager should exist for a given CallClient so if CallClient.getDeviceManager is called multiple times, either a\n * cached ProxyDeviceManager should be returned or the existing ProxyDeviceManager should be destructed via destructor()\n * and a new ProxyDeviceManager created.\n */\nclass ProxyDeviceManager implements ProxyHandler<DeviceManager> {\n private _deviceManager: DeviceManager;\n private _context: CallContext;\n\n constructor(deviceManager: DeviceManager, context: CallContext) {\n this._deviceManager = deviceManager;\n this._context = context;\n\n this.setDeviceManager();\n this.subscribe();\n }\n\n private setDeviceManager = (): void => {\n // isSpeakerSelectionAvailable, selectedMicrophone, and selectedSpeaker are properties on DeviceManager. Since they\n // are not functions we can't proxy them so we'll update whenever we think they may need updating such as at\n // construction time or when certain events happen.\n this._context.setDeviceManagerIsSpeakerSelectionAvailable(this._deviceManager.isSpeakerSelectionAvailable);\n this._context.setDeviceManagerSelectedMicrophone(this._deviceManager.selectedMicrophone);\n this._context.setDeviceManagerSelectedSpeaker(this._deviceManager.selectedSpeaker);\n };\n\n private subscribe = (): void => {\n this._deviceManager.on('videoDevicesUpdated', this.videoDevicesUpdated);\n this._deviceManager.on('audioDevicesUpdated', this.audioDevicesUpdated);\n this._deviceManager.on('selectedMicrophoneChanged', this.selectedMicrophoneChanged);\n this._deviceManager.on('selectedSpeakerChanged', this.selectedSpeakerChanged);\n\n // Subscribe to browser camera permissions changes\n try {\n navigator.permissions.query({ name: 'camera' as PermissionName }).then((cameraPermissions): void => {\n cameraPermissions.addEventListener('change', this.permissionsApiStateChangeHandler);\n });\n } catch (e) {\n console.info('Could not subscribe to Permissions API Camera changed events, API is not supported by browser', e);\n }\n\n // Subscribe to browser microphone permissions changes\n try {\n navigator.permissions.query({ name: 'microphone' as PermissionName }).then((micPermissions): void => {\n micPermissions.addEventListener('change', this.permissionsApiStateChangeHandler);\n });\n } catch (e) {\n console.info(\n 'Could not subscribe to Permissions API Microphone changed events, API is not supported by browser',\n e\n );\n }\n };\n\n /**\n * This is used to unsubscribe DeclarativeDeviceManager from the DeviceManager events.\n */\n public unsubscribe = (): void => {\n this._deviceManager.off('videoDevicesUpdated', this.videoDevicesUpdated);\n this._deviceManager.off('audioDevicesUpdated', this.audioDevicesUpdated);\n this._deviceManager.off('selectedMicrophoneChanged', this.selectedMicrophoneChanged);\n this._deviceManager.off('selectedSpeakerChanged', this.selectedSpeakerChanged);\n\n // Unsubscribe from browser camera permissions changes\n try {\n navigator.permissions.query({ name: 'camera' as PermissionName }).then((cameraPermissions): void => {\n cameraPermissions.removeEventListener('change', this.permissionsApiStateChangeHandler);\n });\n } catch (e) {\n console.info(\n 'Could not Unsubscribe to Permissions API Camera changed events, API is not supported by browser',\n e\n );\n }\n\n // Unsubscribe from browser microphone permissions changes\n try {\n navigator.permissions.query({ name: 'microphone' as PermissionName }).then((micPermissions): void => {\n micPermissions.removeEventListener('change', this.permissionsApiStateChangeHandler);\n });\n } catch (e) {\n console.info(\n 'Could not Unsubscribe to Permissions API Camera changed events, API is not supported by browser',\n e\n );\n }\n };\n\n private permissionsApiStateChangeHandler = async (): Promise<void> => {\n await this.updateDevicePermissionState();\n };\n\n /**\n * Used to set a camera inside the proxy device manager.\n *\n * @param videoDeviceInfo VideoDeviceInfo\n */\n public selectCamera = (videoDeviceInfo: VideoDeviceInfo): void => {\n this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);\n };\n\n private videoDevicesUpdated = async (): Promise<void> => {\n // Device Manager always has a camera with '' name if there are no real camera devices available.\n // We don't want to show that in the UI.\n const realCameras = (await this._deviceManager.getCameras()).filter((c) => !!c.name);\n this._context.setDeviceManagerCameras(dedupeById(realCameras));\n };\n\n private audioDevicesUpdated = async (): Promise<void> => {\n this._context.setDeviceManagerMicrophones(dedupeById(await this._deviceManager.getMicrophones()));\n if (this._deviceManager.isSpeakerSelectionAvailable) {\n this._context.setDeviceManagerSpeakers(dedupeById(await this._deviceManager.getSpeakers()));\n }\n };\n\n private selectedMicrophoneChanged = (): void => {\n this._context.setDeviceManagerSelectedMicrophone(this._deviceManager.selectedMicrophone);\n };\n\n private selectedSpeakerChanged = (): void => {\n this._context.setDeviceManagerSelectedSpeaker(this._deviceManager.selectedSpeaker);\n };\n\n private updateDevicePermissionState = async (sdkDeviceAccessState?: DeviceAccess): Promise<void> => {\n let hasCameraPermission = !!sdkDeviceAccessState?.video;\n let hasMicPermission = !!sdkDeviceAccessState?.audio;\n\n // Supplement the SDK values with values from the Permissions API to get a better understanding of the device\n // permission state. The SDK only uses the getUserMedia API to determine the device permission state. However,\n // this returns false if the camera is in use by another application. The Permissions API can provide more\n // information about the device permission state, but is not supported yet in Firefox or Android WebView.\n // Note: It also has the limitation where it cannot detect if the device is blocked by the Operating System\n // permissions.\n try {\n const [cameraPermissions, micPermissions] = await Promise.all([\n navigator.permissions.query({ name: 'camera' as PermissionName }),\n navigator.permissions.query({ name: 'microphone' as PermissionName })\n ]);\n\n hasCameraPermission = cameraPermissions.state === 'granted';\n hasMicPermission = micPermissions.state === 'granted';\n } catch (e) {\n console.info('Permissions API is not supported by browser', e);\n }\n\n this._context.setDeviceManagerDeviceAccess({\n video: hasCameraPermission,\n audio: hasMicPermission\n });\n this.setDeviceManager();\n };\n\n public get<P extends keyof DeviceManager>(target: DeviceManager, prop: P): any {\n switch (prop) {\n case 'getCameras': {\n return this._context.withAsyncErrorTeedToState((): Promise<VideoDeviceInfo[]> => {\n return target.getCameras().then((cameras: VideoDeviceInfo[]) => {\n // Device Manager always has a camera with '' name if there are no real camera devices available.\n // We don't want to show that in the UI.\n const realCameras = cameras.filter((c) => !!c.name);\n this._context.setDeviceManagerCameras(dedupeById(realCameras));\n return realCameras;\n });\n }, 'DeviceManager.getCameras');\n }\n case 'getMicrophones': {\n return this._context.withAsyncErrorTeedToState((): Promise<AudioDeviceInfo[]> => {\n return target.getMicrophones().then((microphones: AudioDeviceInfo[]) => {\n this._context.setDeviceManagerMicrophones(dedupeById(microphones));\n return microphones;\n });\n }, 'DeviceManager.getMicrophones');\n }\n case 'getSpeakers': {\n return this._context.withAsyncErrorTeedToState((): Promise<AudioDeviceInfo[]> => {\n return target.getSpeakers().then((speakers: AudioDeviceInfo[]) => {\n this._context.setDeviceManagerSpeakers(dedupeById(speakers));\n return speakers;\n });\n }, 'DeviceManager.getSpeakers');\n }\n case 'selectMicrophone': {\n return this._context.withAsyncErrorTeedToState(\n (...args: Parameters<DeviceManager['selectMicrophone']>): Promise<void> => {\n return target.selectMicrophone(...args).then(() => {\n this._context.setDeviceManagerSelectedMicrophone(target.selectedMicrophone);\n });\n },\n 'DeviceManager.selectMicrophone'\n );\n }\n case 'selectSpeaker': {\n return this._context.withAsyncErrorTeedToState(\n (...args: Parameters<DeviceManager['selectSpeaker']>): Promise<void> => {\n return target.selectSpeaker(...args).then(() => {\n this._context.setDeviceManagerSelectedSpeaker(target.selectedSpeaker);\n });\n },\n 'DeviceManager.selectSpeaker'\n );\n }\n case 'askDevicePermission': {\n return this._context.withAsyncErrorTeedToState(\n (...args: Parameters<DeviceManager['askDevicePermission']>): Promise<DeviceAccess> => {\n return target.askDevicePermission(...args).then(async (deviceAccess: DeviceAccess) => {\n await this.updateDevicePermissionState(deviceAccess);\n return deviceAccess;\n });\n },\n 'DeviceManager.askDevicePermission'\n );\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n// TODO: Remove this when SDK no longer returns duplicate audio and video devices\n/** Helper function to dedupe duplicate audio and video devices obtained from SDK */\nconst dedupeById = <T extends { id: string }>(devices: T[]): T[] => {\n const ids = new Set();\n const uniqueDevices: T[] = [];\n devices.forEach((device: T) => {\n if (!ids.has(device.id)) {\n uniqueDevices.push(device);\n ids.add(device.id);\n }\n });\n return uniqueDevices;\n};\n\n/**\n * Creates a declarative DeviceManager by proxying DeviceManager with ProxyDeviceManager. The declarative DeviceManager\n * will put state updates in the given context.\n *\n * @param deviceManager - DeviceManager from SDK\n * @param context - CallContext from StatefulCallClient\n *\n * @private\n */\nexport const deviceManagerDeclaratify = (\n deviceManager: DeviceManager,\n context: CallContext,\n internalContext: InternalCallContext\n): DeviceManager => {\n const proxyDeviceManager = new ProxyDeviceManager(deviceManager, context);\n Object.defineProperty(deviceManager, 'unsubscribe', {\n configurable: false,\n value: () => proxyDeviceManager.unsubscribe()\n });\n Object.defineProperty(deviceManager, 'selectCamera', {\n configurable: false,\n value: (videoDeviceInfo: VideoDeviceInfo) => proxyDeviceManager.selectCamera(videoDeviceInfo)\n });\n\n Object.defineProperty(deviceManager, 'getUnparentedVideoStreams', {\n configurable: false,\n value: (): LocalVideoStream[] => internalContext.getUnparentedRenderInfos()\n });\n return new Proxy(deviceManager, proxyDeviceManager) as StatefulDeviceManager;\n};\n"]}
|
1
|
+
{"version":3,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,CACtC,aAA4B,EAC5B,OAAoB,EACpB,eAAoC,EACrB,EAAE;IACjB,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAC1E,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,aAAa,EAAE;QAClD,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,WAAW,EAAE;KAC9C,CAAC,CAAC;IACH,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,cAAc,EAAE;QACnD,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,CAAC,eAAgC,EAAE,EAAE,CAAC,kBAAkB,CAAC,YAAY,CAAC,eAAe,CAAC;KAC9F,CAAC,CAAC;IAEH,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,2BAA2B,EAAE;QAChE,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,GAAuB,EAAE,CAAC,eAAe,CAAC,wBAAwB,EAAE;KAC5E,CAAC,CAAC;IACH,OAAO,IAAI,KAAK,CAAC,aAAa,EAAE,kBAAkB,CAA0B,CAAC;AAC/E,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AudioDeviceInfo, DeviceAccess, DeviceManager, VideoDeviceInfo } from '@azure/communication-calling';\nimport { CallContext } from './CallContext';\nimport { InternalCallContext } from './InternalCallContext';\n\nimport { LocalVideoStream } from '@azure/communication-calling';\n\n/**\n * Defines the additional methods added by the stateful on top of {@link @azure/communication-calling#DeviceManager}.\n *\n * @public\n */\nexport interface StatefulDeviceManager extends DeviceManager {\n /**\n * Sets the selectedCamera in the {@link DeviceManagerState}. This is completely developer driven and is not tied in\n * any way to {@link @azure/communication-calling#DeviceManager}. It is entirely contained in\n * {@link StatefulDeviceManager}. See also {@link DeviceManagerState.selectedCamera}.\n */\n selectCamera: (device: VideoDeviceInfo) => void;\n\n /**\n * Gets the list of unparented video streams. This is a list of video streams that have not been added to a\n * {@link @azure/communication-calling#Call}. This is useful for developers who want to interact with rendered\n * video streams before they have started a call. See also {@link @azure/communication-react#CallClient.createView}.\n *\n * @public\n */\n getUnparentedVideoStreams: () => LocalVideoStream[];\n}\n\n/**\n * ProxyDeviceManager proxies DeviceManager and subscribes to all events that affect device manager state. State updates\n * are set on the provided context. Also any queries for state are proxied and stored in state as well. Only one device\n * manager should exist for a given CallClient so if CallClient.getDeviceManager is called multiple times, either a\n * cached ProxyDeviceManager should be returned or the existing ProxyDeviceManager should be destructed via destructor()\n * and a new ProxyDeviceManager created.\n */\nclass ProxyDeviceManager implements ProxyHandler<DeviceManager> {\n private _deviceManager: DeviceManager;\n private _context: CallContext;\n\n constructor(deviceManager: DeviceManager, context: CallContext) {\n this._deviceManager = deviceManager;\n this._context = context;\n\n this.setDeviceManager();\n this.subscribe();\n }\n\n private setDeviceManager = (): void => {\n // isSpeakerSelectionAvailable, selectedMicrophone, and selectedSpeaker are properties on DeviceManager. Since they\n // are not functions we can't proxy them so we'll update whenever we think they may need updating such as at\n // construction time or when certain events happen.\n this._context.setDeviceManagerIsSpeakerSelectionAvailable(this._deviceManager.isSpeakerSelectionAvailable);\n this._context.setDeviceManagerSelectedMicrophone(this._deviceManager.selectedMicrophone);\n this._context.setDeviceManagerSelectedSpeaker(this._deviceManager.selectedSpeaker);\n };\n\n private subscribe = (): void => {\n this._deviceManager.on('videoDevicesUpdated', this.videoDevicesUpdated);\n this._deviceManager.on('audioDevicesUpdated', this.audioDevicesUpdated);\n this._deviceManager.on('selectedMicrophoneChanged', this.selectedMicrophoneChanged);\n this._deviceManager.on('selectedSpeakerChanged', this.selectedSpeakerChanged);\n\n // Subscribe to browser camera permissions changes\n if (navigator.permissions) {\n try {\n navigator.permissions.query({ name: 'camera' as PermissionName }).then((cameraPermissions): void => {\n cameraPermissions.addEventListener('change', this.permissionsApiStateChangeHandler);\n });\n } catch (e) {\n console.info(\n 'Could not subscribe to Permissions API Camera changed events, API is not supported by browser',\n e\n );\n }\n\n // Subscribe to browser microphone permissions changes\n try {\n navigator.permissions.query({ name: 'microphone' as PermissionName }).then((micPermissions): void => {\n micPermissions.addEventListener('change', this.permissionsApiStateChangeHandler);\n });\n } catch (e) {\n console.info(\n 'Could not subscribe to Permissions API Microphone changed events, API is not supported by browser',\n e\n );\n }\n }\n };\n\n /**\n * This is used to unsubscribe DeclarativeDeviceManager from the DeviceManager events.\n */\n public unsubscribe = (): void => {\n this._deviceManager.off('videoDevicesUpdated', this.videoDevicesUpdated);\n this._deviceManager.off('audioDevicesUpdated', this.audioDevicesUpdated);\n this._deviceManager.off('selectedMicrophoneChanged', this.selectedMicrophoneChanged);\n this._deviceManager.off('selectedSpeakerChanged', this.selectedSpeakerChanged);\n\n if (navigator.permissions) {\n // Unsubscribe from browser camera permissions changes\n try {\n navigator.permissions.query({ name: 'camera' as PermissionName }).then((cameraPermissions): void => {\n cameraPermissions.removeEventListener('change', this.permissionsApiStateChangeHandler);\n });\n } catch (e) {\n console.info(\n 'Could not Unsubscribe to Permissions API Camera changed events, API is not supported by browser',\n e\n );\n }\n\n // Unsubscribe from browser microphone permissions changes\n try {\n navigator.permissions.query({ name: 'microphone' as PermissionName }).then((micPermissions): void => {\n micPermissions.removeEventListener('change', this.permissionsApiStateChangeHandler);\n });\n } catch (e) {\n console.info(\n 'Could not Unsubscribe to Permissions API Camera changed events, API is not supported by browser',\n e\n );\n }\n }\n };\n\n private permissionsApiStateChangeHandler = async (): Promise<void> => {\n await this.updateDevicePermissionState();\n };\n\n /**\n * Used to set a camera inside the proxy device manager.\n *\n * @param videoDeviceInfo VideoDeviceInfo\n */\n public selectCamera = (videoDeviceInfo: VideoDeviceInfo): void => {\n this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);\n };\n\n private videoDevicesUpdated = async (): Promise<void> => {\n // Device Manager always has a camera with '' name if there are no real camera devices available.\n // We don't want to show that in the UI.\n const realCameras = (await this._deviceManager.getCameras()).filter((c) => !!c.name);\n this._context.setDeviceManagerCameras(dedupeById(realCameras));\n };\n\n private audioDevicesUpdated = async (): Promise<void> => {\n this._context.setDeviceManagerMicrophones(dedupeById(await this._deviceManager.getMicrophones()));\n if (this._deviceManager.isSpeakerSelectionAvailable) {\n this._context.setDeviceManagerSpeakers(dedupeById(await this._deviceManager.getSpeakers()));\n }\n };\n\n private selectedMicrophoneChanged = (): void => {\n this._context.setDeviceManagerSelectedMicrophone(this._deviceManager.selectedMicrophone);\n };\n\n private selectedSpeakerChanged = (): void => {\n this._context.setDeviceManagerSelectedSpeaker(this._deviceManager.selectedSpeaker);\n };\n\n private updateDevicePermissionState = async (sdkDeviceAccessState?: DeviceAccess): Promise<void> => {\n let hasCameraPermission = !!sdkDeviceAccessState?.video;\n let hasMicPermission = !!sdkDeviceAccessState?.audio;\n\n // Supplement the SDK values with values from the Permissions API to get a better understanding of the device\n // permission state. The SDK only uses the getUserMedia API to determine the device permission state. However,\n // this returns false if the camera is in use by another application. The Permissions API can provide more\n // information about the device permission state, but is not supported yet in Firefox or Android WebView.\n // Note: It also has the limitation where it cannot detect if the device is blocked by the Operating System\n // permissions.\n if (navigator.permissions) {\n try {\n const [cameraPermissions, micPermissions] = await Promise.all([\n navigator.permissions.query({ name: 'camera' as PermissionName }),\n navigator.permissions.query({ name: 'microphone' as PermissionName })\n ]);\n\n hasCameraPermission = cameraPermissions.state === 'granted';\n hasMicPermission = micPermissions.state === 'granted';\n } catch (e) {\n console.info('Permissions API is not supported by browser', e);\n }\n }\n\n this._context.setDeviceManagerDeviceAccess({\n video: hasCameraPermission,\n audio: hasMicPermission\n });\n this.setDeviceManager();\n };\n\n public get<P extends keyof DeviceManager>(target: DeviceManager, prop: P): any {\n switch (prop) {\n case 'getCameras': {\n return this._context.withAsyncErrorTeedToState((): Promise<VideoDeviceInfo[]> => {\n return target.getCameras().then((cameras: VideoDeviceInfo[]) => {\n // Device Manager always has a camera with '' name if there are no real camera devices available.\n // We don't want to show that in the UI.\n const realCameras = cameras.filter((c) => !!c.name);\n this._context.setDeviceManagerCameras(dedupeById(realCameras));\n return realCameras;\n });\n }, 'DeviceManager.getCameras');\n }\n case 'getMicrophones': {\n return this._context.withAsyncErrorTeedToState((): Promise<AudioDeviceInfo[]> => {\n return target.getMicrophones().then((microphones: AudioDeviceInfo[]) => {\n this._context.setDeviceManagerMicrophones(dedupeById(microphones));\n return microphones;\n });\n }, 'DeviceManager.getMicrophones');\n }\n case 'getSpeakers': {\n return this._context.withAsyncErrorTeedToState((): Promise<AudioDeviceInfo[]> => {\n return target.getSpeakers().then((speakers: AudioDeviceInfo[]) => {\n this._context.setDeviceManagerSpeakers(dedupeById(speakers));\n return speakers;\n });\n }, 'DeviceManager.getSpeakers');\n }\n case 'selectMicrophone': {\n return this._context.withAsyncErrorTeedToState(\n (...args: Parameters<DeviceManager['selectMicrophone']>): Promise<void> => {\n return target.selectMicrophone(...args).then(() => {\n this._context.setDeviceManagerSelectedMicrophone(target.selectedMicrophone);\n });\n },\n 'DeviceManager.selectMicrophone'\n );\n }\n case 'selectSpeaker': {\n return this._context.withAsyncErrorTeedToState(\n (...args: Parameters<DeviceManager['selectSpeaker']>): Promise<void> => {\n return target.selectSpeaker(...args).then(() => {\n this._context.setDeviceManagerSelectedSpeaker(target.selectedSpeaker);\n });\n },\n 'DeviceManager.selectSpeaker'\n );\n }\n case 'askDevicePermission': {\n return this._context.withAsyncErrorTeedToState(\n (...args: Parameters<DeviceManager['askDevicePermission']>): Promise<DeviceAccess> => {\n return target.askDevicePermission(...args).then(async (deviceAccess: DeviceAccess) => {\n await this.updateDevicePermissionState(deviceAccess);\n return deviceAccess;\n });\n },\n 'DeviceManager.askDevicePermission'\n );\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n// TODO: Remove this when SDK no longer returns duplicate audio and video devices\n/** Helper function to dedupe duplicate audio and video devices obtained from SDK */\nconst dedupeById = <T extends { id: string }>(devices: T[]): T[] => {\n const ids = new Set();\n const uniqueDevices: T[] = [];\n devices.forEach((device: T) => {\n if (!ids.has(device.id)) {\n uniqueDevices.push(device);\n ids.add(device.id);\n }\n });\n return uniqueDevices;\n};\n\n/**\n * Creates a declarative DeviceManager by proxying DeviceManager with ProxyDeviceManager. The declarative DeviceManager\n * will put state updates in the given context.\n *\n * @param deviceManager - DeviceManager from SDK\n * @param context - CallContext from StatefulCallClient\n *\n * @private\n */\nexport const deviceManagerDeclaratify = (\n deviceManager: DeviceManager,\n context: CallContext,\n internalContext: InternalCallContext\n): DeviceManager => {\n const proxyDeviceManager = new ProxyDeviceManager(deviceManager, context);\n Object.defineProperty(deviceManager, 'unsubscribe', {\n configurable: false,\n value: () => proxyDeviceManager.unsubscribe()\n });\n Object.defineProperty(deviceManager, 'selectCamera', {\n configurable: false,\n value: (videoDeviceInfo: VideoDeviceInfo) => proxyDeviceManager.selectCamera(videoDeviceInfo)\n });\n\n Object.defineProperty(deviceManager, 'getUnparentedVideoStreams', {\n configurable: false,\n value: (): LocalVideoStream[] => internalContext.getUnparentedRenderInfos()\n });\n return new Proxy(deviceManager, proxyDeviceManager) as StatefulDeviceManager;\n};\n"]}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { CallClient, CallClientOptions, CreateViewOptions } from '@azure/communication-calling';
|
2
2
|
import { CallClientState, LocalVideoStreamState, RemoteVideoStreamState } from './CallClientState';
|
3
|
+
import { TogetherModeStreamState } from './CallClientState';
|
3
4
|
import { CallContext } from './CallContext';
|
4
5
|
import { DeclarativeCallAgent } from './CallAgentDeclarative';
|
5
6
|
import { InternalCallContext } from './InternalCallContext';
|
@@ -93,7 +94,7 @@ export interface StatefulCallClient extends CallClient {
|
|
93
94
|
* @param stream - The LocalVideoStreamState or RemoteVideoStreamState to start rendering.
|
94
95
|
* @param options - Options that are passed to the {@link @azure/communication-calling#VideoStreamRenderer}.
|
95
96
|
*/
|
96
|
-
createView(callId: string | undefined, participantId: CommunicationIdentifier | undefined, stream: LocalVideoStreamState | RemoteVideoStreamState, options?: CreateViewOptions): Promise<CreateViewResult | undefined>;
|
97
|
+
createView(callId: string | undefined, participantId: CommunicationIdentifier | undefined, stream: LocalVideoStreamState | RemoteVideoStreamState | /* @conditional-compile-remove(together-mode) */ TogetherModeStreamState, options?: CreateViewOptions): Promise<CreateViewResult | undefined>;
|
97
98
|
/**
|
98
99
|
* Stops rendering a {@link RemoteVideoStreamState} or {@link LocalVideoStreamState} and removes the
|
99
100
|
* {@link VideoStreamRendererView} from the relevant {@link RemoteVideoStreamState} in {@link CallClientState} or
|