@azure/communication-react 1.21.0-alpha-202411050016 → 1.21.0-alpha-202411070016
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 +96 -31
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CjlQQrAc.js → ChatMessageComponentAsRichTextEditBox-DA7CJian.js} +3 -3
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CjlQQrAc.js.map → ChatMessageComponentAsRichTextEditBox-DA7CJian.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CEFO0M1q.js → RichTextSendBoxWrapper-B35hPtZ7.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CEFO0M1q.js.map → RichTextSendBoxWrapper-B35hPtZ7.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-BkinusDu.js → index-DKFJEPz7.js} +655 -129
- package/dist/dist-cjs/communication-react/index-DKFJEPz7.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +60 -31
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +13 -2
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js +106 -5
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallFeatureStreamUtils.d.ts +14 -0
- package/dist/dist-esm/calling-stateful-client/src/CallFeatureStreamUtils.js +207 -0
- package/dist/dist-esm/calling-stateful-client/src/CallFeatureStreamUtils.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +1 -0
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +7 -1
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.d.ts +6 -0
- package/dist/dist-esm/calling-stateful-client/src/Converter.js +18 -2
- package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.d.ts +9 -0
- package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js +50 -0
- package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/MediaAccessSubscriber.d.ts +16 -0
- package/dist/dist-esm/calling-stateful-client/src/MediaAccessSubscriber.js +26 -0
- package/dist/dist-esm/calling-stateful-client/src/MediaAccessSubscriber.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +33 -2
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +17 -0
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StreamUtils.d.ts +1 -2
- package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js +10 -0
- package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TogetherModeSubscriber.d.ts +9 -4
- package/dist/dist-esm/calling-stateful-client/src/TogetherModeSubscriber.js +38 -9
- package/dist/dist-esm/calling-stateful-client/src/TogetherModeSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TogetherModeVideoStreamSubscriber.d.ts +18 -0
- package/dist/dist-esm/calling-stateful-client/src/TogetherModeVideoStreamSubscriber.js +34 -0
- package/dist/dist-esm/calling-stateful-client/src/TogetherModeVideoStreamSubscriber.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +2 -1
- package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +3 -3
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js +4 -3
- package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.js +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.js +13 -11
- package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +9 -2
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/MessageBarLink.styles.d.ts +11 -0
- package/dist/dist-esm/react-components/src/components/styles/MessageBarLink.styles.js +21 -0
- package/dist/dist-esm/react-components/src/components/styles/MessageBarLink.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.d.ts +2 -0
- package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +6 -0
- package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +4 -2
- 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/styles/CallConfiguration.styles.js +4 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.js +6 -2
- package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.d.ts +3 -1
- package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js +9 -1
- package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js.map +1 -1
- package/package.json +2 -2
- package/dist/dist-cjs/communication-react/index-BkinusDu.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"StreamUtils.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/StreamUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAEL,gBAAgB,EAEhB,mBAAmB,EAEpB,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EACL,6CAA6C,EAC7C,+CAA+C,EAC/C,kDAAkD,EACnD,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,6BAA6B,EAAa,gCAAgC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAYvD,SAAe,eAAe,CAC5B,OAAoB,EACpB,eAAoC,EACpC,MAAc,EACd,MAG4E,EAC5E,aAAoD,EACpD,OAA2B;;QAE3B,yCAAyC;QACzC,IAAI,eAAgF,CAAC;QAErF,6GAA6G;QAE7G,IAAI,aAAa,EAAE,CAAC;YAClB,eAAe,GAAG,kBAAkB,CAAC;QACvC,CAAC;aAAM,IAAI,MAAM,EAAE,CAAC;YAClB,eAAe,GAAG,iBAAiB,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,wCAAwC;YACxC,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;YAClE,eAAe,GAAG,sBAAsB,CAAC;QAC3C,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,aAAN,MAAM,uBAAN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OAAO,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n CreateViewOptions,\n LocalVideoStream,\n RemoteVideoStream,\n VideoStreamRenderer,\n VideoStreamRendererView\n} from '@azure/communication-calling';\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport { LocalVideoStreamState, RemoteVideoStreamState } from './CallClientState';\n/* @conditional-compile-remove(together-mode) */\nimport { TogetherModeStreamState } from './CallClientState';\nimport { CallContext } from './CallContext';\nimport {\n convertSdkLocalStreamToDeclarativeLocalStream,\n convertSdkRemoteStreamToDeclarativeRemoteStream,\n convertFromSDKToDeclarativeVideoStreamRendererView\n} from './Converter';\nimport { InternalCallContext } from './InternalCallContext';\nimport { toFlatCommunicationIdentifier, _logEvent } from '@internal/acs-ui-common';\nimport { EventNames } from './Logger';\nimport { _logStreamEvent } from './StreamUtilsLogging';\n\n/**\n * Return result from {@link StatefulCallClient.createView}.\n *\n * @public\n */\nexport type CreateViewResult = {\n renderer: VideoStreamRenderer;\n view: VideoStreamRendererView;\n};\n\nasync function createViewVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string,\n stream?:\n | RemoteVideoStreamState\n | LocalVideoStreamState\n | /* @conditional-compile-remove(together-mode) */ TogetherModeStreamState,\n participantId?: CommunicationIdentifierKind | string,\n options?: CreateViewOptions\n): Promise<CreateViewResult | undefined> {\n // we can only have 3 types of createView\n let streamEventType: 'createViewLocal' | 'createViewRemote' | 'createViewUnparented';\n\n // we will reuse these for local as well but we need to make sure the remote stream is passed in like before.\n\n if (participantId) {\n streamEventType = 'createViewRemote';\n } else if (callId) {\n streamEventType = 'createViewLocal';\n } else {\n // TODO update for when unparented view.\n throw new Error('unparented createView not implemented yet here');\n streamEventType = 'createViewUnparented';\n }\n\n const streamType = stream?.mediaStreamType;\n const localStreamKey = (stream as LocalVideoStream).mediaStreamType;\n const remoteStreamId = (stream as RemoteVideoStream).id;\n\n // we want to check to see if there is a participantId this will tell us whether its a local stream or a remote one.\n const participantKey =\n streamEventType === 'createViewRemote' && participantId\n ? typeof participantId === 'string'\n ? participantId\n : toFlatCommunicationIdentifier(participantId)\n : undefined;\n\n const streamLogInfo = {\n callId,\n participantKey,\n streamId: remoteStreamId ?? localStreamKey,\n streamType,\n streamEventType\n };\n\n // make different logging announcement based on whether or not we are starting a local or remote\n _logStreamEvent(EventNames.CREATING_VIEW, streamLogInfo);\n\n // if we have a participant Id and a stream get the remote info, else get the local render info from state.\n const renderInfo =\n streamEventType === 'createViewRemote' && participantKey\n ? internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, remoteStreamId)\n : internalContext.getLocalRenderInfo(callId, localStreamKey);\n\n if (!renderInfo) {\n _logStreamEvent(EventNames.STREAM_NOT_FOUND, streamLogInfo);\n return;\n }\n\n if (renderInfo.status === 'Rendered') {\n _logStreamEvent(EventNames.STREAM_ALREADY_RENDERED, streamLogInfo);\n return;\n }\n\n if (renderInfo.status === 'Rendering') {\n // Do not log to console here as this is a very common situation due to UI rerenders while\n // the video rendering is in progress.\n _logStreamEvent(EventNames.STREAM_RENDERING, streamLogInfo);\n return;\n }\n\n // \"Stopping\" only happens if the stream was in \"rendering\" but `disposeView` was called.\n // Now that `createView` has been re-called, we can flip the state back to \"rendering\".\n if (renderInfo.status === 'Stopping') {\n if (streamEventType === 'createViewRemote' && participantKey) {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n remoteStreamId,\n renderInfo.stream as RemoteVideoStream,\n 'Rendering',\n renderInfo.renderer\n );\n } else if (streamEventType === 'createViewLocal') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n internalContext.setLocalRenderInfo(\n callId,\n localStreamKey,\n renderInfo.stream as LocalVideoStream,\n 'Rendering',\n renderInfo.renderer\n );\n }\n return;\n }\n\n const renderer = new VideoStreamRenderer(renderInfo.stream);\n\n streamEventType === 'createViewRemote' && participantKey\n ? internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n remoteStreamId,\n renderInfo.stream as RemoteVideoStream,\n 'Rendering',\n undefined\n )\n : internalContext.setLocalRenderInfo(\n callId,\n localStreamKey,\n renderInfo.stream as LocalVideoStream,\n 'Rendering',\n renderer\n );\n\n let view;\n try {\n view = await renderer.createView(options);\n } catch (e) {\n if (streamEventType === 'createViewRemote' && participantKey) {\n _logStreamEvent(EventNames.CREATE_STREAM_FAIL, streamLogInfo);\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n remoteStreamId,\n renderInfo.stream as RemoteVideoStream,\n 'NotRendered',\n undefined\n );\n } else if (streamEventType === 'createViewLocal') {\n _logStreamEvent(EventNames.CREATE_STREAM_FAIL, streamLogInfo, e);\n internalContext.setLocalRenderInfo(\n callId,\n localStreamKey,\n renderInfo.stream as LocalVideoStream,\n 'NotRendered',\n undefined\n );\n }\n throw e;\n }\n\n // Since render could take some time, we need to check if the stream is still valid and if we received a signal to\n // stop rendering.\n const refreshedRenderInfo =\n streamEventType === 'createViewRemote' && participantKey\n ? internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, remoteStreamId)\n : internalContext.getLocalRenderInfo(callId, localStreamKey);\n\n if (!refreshedRenderInfo) {\n // RenderInfo was removed. This should not happen unless stream was removed from the call so dispose the renderer\n // and clean up the state.\n _logStreamEvent(EventNames.RENDER_INFO_NOT_FOUND, streamLogInfo);\n renderer.dispose();\n streamEventType === 'createViewRemote' && participantKey\n ? context.setRemoteVideoStreamRendererView(callId, participantKey, remoteStreamId, undefined)\n : context.setLocalVideoStreamRendererView(callId, localStreamKey, undefined);\n return;\n }\n\n if (refreshedRenderInfo.status === 'Stopping') {\n // Stop render was called on this stream after we had started rendering. We will dispose this view and do not\n // put the view into the state.\n streamEventType === 'createViewRemote';\n _logStreamEvent(EventNames.CREATED_STREAM_STOPPING, streamLogInfo);\n renderer.dispose();\n if (streamEventType === 'createViewRemote' && participantKey) {\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n remoteStreamId,\n refreshedRenderInfo.stream as RemoteVideoStream,\n 'NotRendered',\n undefined\n );\n context.setRemoteVideoStreamRendererView(callId, participantKey, remoteStreamId, undefined);\n } else if (streamEventType === 'createViewLocal') {\n internalContext.setLocalRenderInfo(\n callId,\n localStreamKey,\n refreshedRenderInfo.stream as LocalVideoStream,\n 'NotRendered',\n undefined\n );\n context.setLocalVideoStreamRendererView(callId, localStreamKey, undefined);\n }\n return;\n }\n\n // Else the stream still exists and status is not telling us to stop rendering. Complete the render process by\n // updating the state.\n if (streamEventType === 'createViewRemote' && participantKey) {\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n remoteStreamId,\n refreshedRenderInfo.stream as RemoteVideoStream,\n 'Rendered',\n renderer\n );\n context.setRemoteVideoStreamRendererView(\n callId,\n participantKey,\n remoteStreamId,\n convertFromSDKToDeclarativeVideoStreamRendererView(view)\n );\n _logStreamEvent(EventNames.VIEW_RENDER_SUCCEED, streamLogInfo);\n } else if (streamEventType === 'createViewLocal') {\n internalContext.setLocalRenderInfo(\n callId,\n localStreamKey,\n refreshedRenderInfo.stream as LocalVideoStream,\n 'Rendered',\n renderer\n );\n context.setLocalVideoStreamRendererView(\n callId,\n localStreamKey,\n convertFromSDKToDeclarativeVideoStreamRendererView(view)\n );\n _logStreamEvent(EventNames.VIEW_RENDER_SUCCEED, streamLogInfo);\n }\n\n return {\n renderer,\n view\n };\n}\n\nasync function createViewUnparentedVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n stream: LocalVideoStreamState,\n options?: CreateViewOptions\n): Promise<CreateViewResult | undefined> {\n const renderInfo = internalContext.getUnparentedRenderInfo(stream);\n\n if (renderInfo && renderInfo.status === 'Rendered') {\n console.warn('Unparented LocalVideoStream is already rendered');\n return;\n }\n\n if (renderInfo && renderInfo.status === 'Rendering') {\n // Do not log to console here as this is a very common situation due to UI rerenders while\n // the video rendering is in progress.\n return;\n }\n\n if (renderInfo && renderInfo.status === 'Stopping') {\n console.warn('Unparented LocalVideoStream is in the middle of stopping');\n return;\n }\n\n const localVideoStream = new LocalVideoStream(stream.source);\n const renderer = new VideoStreamRenderer(localVideoStream);\n\n internalContext.setUnparentedRenderInfo(stream, localVideoStream, 'Rendering', undefined);\n\n let view: VideoStreamRendererView;\n try {\n view = await renderer.createView(options);\n } catch (e) {\n // Special case for unparented views. Since they are not tied to anything and created by us based on the calls to\n // this function we'll delete it to clean up the data since keeping it around doesn't help us and if developer wants\n // to create a new view they can check that the view is not rendered and call this function again.\n internalContext.deleteUnparentedRenderInfo(stream);\n throw e;\n }\n\n // Since render could take some time, we need to check if the stream is still valid and if we received a signal to\n // stop rendering.\n const refreshedRenderInfo = internalContext.getUnparentedRenderInfo(stream);\n if (!refreshedRenderInfo) {\n // Unparented stream's RenderInfo was deleted. Currently this shouldn't happen but if it does we'll just dispose the\n // renderer and clean up state. If developer wanted the stream they could call this function again and that should\n // generate new working state via this function.\n renderer.dispose();\n context.deleteDeviceManagerUnparentedView(stream);\n return;\n }\n\n if (refreshedRenderInfo.status === 'Stopping') {\n // Stop render was called on this stream after we had started rendering. We will dispose this view and do not\n // put the view into the state. Special case for unparented views, delete them from state when stopped to free up\n // the memory since we were the ones generating this and not tied to any Call state.\n internalContext.deleteUnparentedRenderInfo(stream);\n context.deleteDeviceManagerUnparentedView(stream);\n return;\n }\n // Else the stream still exists and status is not telling us to stop rendering. Complete the render process by\n // updating the state.\n internalContext.setUnparentedRenderInfo(stream, localVideoStream, 'Rendered', renderer);\n internalContext.subscribeToUnparentedViewVideoEffects(localVideoStream, context);\n context.setDeviceManagerUnparentedView(stream, convertFromSDKToDeclarativeVideoStreamRendererView(view));\n\n return {\n renderer,\n view\n };\n}\n\nfunction disposeViewVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string,\n stream: RemoteVideoStreamState | LocalVideoStreamState,\n participantId?: CommunicationIdentifierKind | string\n): void {\n // we can only have 3 types of createView\n let streamEventType: 'disposeViewLocal' | 'disposeViewRemote' | 'disposeViewUnparented';\n\n // we will reuse these for local as well but we need to make sure the remote stream is passed in like before.\n\n if (participantId) {\n streamEventType = 'disposeViewRemote';\n } else if (callId) {\n streamEventType = 'disposeViewLocal';\n } else {\n // TODO update for when unparented view.\n streamEventType = 'disposeViewUnparented';\n }\n\n const streamType = stream.mediaStreamType;\n const localStreamKey = (stream as LocalVideoStream).mediaStreamType;\n const remoteStreamId = (stream as RemoteVideoStream).id;\n\n // we want to check to see if there is a participantId this will tell us whether its a local stream or a remote one.\n const participantKey =\n streamEventType === 'disposeViewRemote' && participantId\n ? typeof participantId === 'string'\n ? participantId\n : toFlatCommunicationIdentifier(participantId)\n : undefined;\n const streamLogInfo = { callId, participantKey, streamId: remoteStreamId ?? localStreamKey, streamType };\n\n _logStreamEvent(EventNames.START_DISPOSE_STREAM, streamLogInfo);\n\n if (streamEventType === 'disposeViewRemote' && participantKey) {\n context.setRemoteVideoStreamRendererView(callId, participantKey, remoteStreamId, undefined);\n }\n\n const renderInfo =\n streamEventType === 'disposeViewRemote' && participantKey\n ? internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, remoteStreamId)\n : internalContext.getLocalRenderInfo(callId, localStreamKey);\n\n if (!renderInfo) {\n _logStreamEvent(EventNames.DISPOSE_INFO_NOT_FOUND, streamLogInfo);\n return;\n }\n\n // Nothing to dispose of or clean up -- we can safely exit early here.\n if (renderInfo.status === 'NotRendered') {\n _logStreamEvent(EventNames.STREAM_ALREADY_DISPOSED, streamLogInfo);\n return;\n }\n\n // Status is already marked as \"stopping\" so we can exit early here. This is because stopping only occurs\n // when the stream is being created in createView but hasn't been completed being created yet. The createView\n // method will see the \"stopping\" status and perform the cleanup\n if (renderInfo.status === 'Stopping') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n return;\n }\n\n // If the stream is in the middle of being rendered (i.e. has state \"Rendering\"), we need the status as\n // \"stopping\" without performing any cleanup. This will tell the `createView` method that it should stop\n // rendering and clean up the state once the view has finished being created.\n if (renderInfo.status === 'Rendering') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n streamEventType === 'disposeViewRemote' && participantKey\n ? internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n remoteStreamId,\n renderInfo.stream as RemoteVideoStream,\n 'Stopping',\n undefined\n )\n : internalContext.setLocalRenderInfo(\n callId,\n localStreamKey,\n renderInfo.stream as LocalVideoStream,\n 'Stopping',\n renderInfo.renderer\n );\n return;\n }\n\n if (renderInfo.renderer) {\n _logStreamEvent(EventNames.DISPOSING_RENDERER, streamLogInfo);\n renderInfo.renderer.dispose();\n // Else the state must be in the \"Rendered\" state, so we can dispose the renderer and clean up the state.\n if (streamEventType === 'disposeViewRemote' && participantKey) {\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n remoteStreamId,\n renderInfo.stream as RemoteVideoStream,\n 'NotRendered',\n undefined\n );\n } else if (streamEventType === 'disposeViewLocal') {\n internalContext.setLocalRenderInfo(\n callId,\n localStreamKey,\n renderInfo.stream as LocalVideoStream,\n 'NotRendered',\n undefined\n );\n context.setLocalVideoStreamRendererView(callId, localStreamKey, undefined);\n }\n } else {\n _logStreamEvent(EventNames.RENDERER_NOT_FOUND, streamLogInfo);\n }\n}\n\nfunction disposeViewUnparentedVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n stream: LocalVideoStreamState\n): void {\n const streamType = stream.mediaStreamType;\n const streamLogInfo = { streamType, streamEventType: 'disposeViewUnparented' };\n\n _logStreamEvent(EventNames.START_DISPOSE_STREAM, streamLogInfo);\n\n context.deleteDeviceManagerUnparentedView(stream);\n\n const renderInfo = internalContext.getUnparentedRenderInfo(stream);\n if (!renderInfo) {\n _logStreamEvent(EventNames.DISPOSE_INFO_NOT_FOUND, streamLogInfo);\n return;\n }\n\n if (renderInfo.status === 'Rendering') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n internalContext.setUnparentedRenderInfo(stream, renderInfo.stream, 'Stopping', undefined);\n } else {\n internalContext.deleteUnparentedRenderInfo(stream);\n }\n\n if (renderInfo.renderer) {\n _logStreamEvent(EventNames.DISPOSING_RENDERER, streamLogInfo);\n renderInfo.renderer.dispose();\n } else {\n _logStreamEvent(EventNames.RENDERER_NOT_FOUND, streamLogInfo);\n }\n}\n\n/**\n * @private\n */\nexport function createView(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string | undefined,\n participantId: CommunicationIdentifierKind | string | undefined,\n stream:\n | LocalVideoStreamState\n | RemoteVideoStreamState\n | /* @conditional-compile-remove(together-mode) */ TogetherModeStreamState,\n options?: CreateViewOptions\n): Promise<CreateViewResult | undefined> {\n const streamType = stream.mediaStreamType;\n\n if (callId) {\n return createViewVideo(context, internalContext, callId, stream, participantId, options);\n } else if (!('id' in stream) && !callId) {\n // Render LocalVideoStream that is not part of a Call\n // Because it is not part of the call we don't tee errors to state naturally (e.g. via a Call Client function such as startVideo).\n // We do not have a startLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.\n return context.withAsyncErrorTeedToState(\n async () => await createViewUnparentedVideo(context, internalContext, stream, options),\n 'Call.startVideo'\n )();\n } else {\n _logStreamEvent(EventNames.CREATE_STREAM_INVALID_PARAMS, { streamType });\n return Promise.resolve(undefined);\n }\n}\n\n/**\n * @private\n */\nexport function disposeView(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string | undefined,\n participantId: CommunicationIdentifierKind | string | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState\n): void {\n const streamType = stream.mediaStreamType;\n if (callId) {\n disposeViewVideo(context, internalContext, callId, stream, participantId);\n } else if (!('id' in stream) && !callId) {\n // Stop rendering LocalVideoStream that is not part of a Call\n // Because it is not part of the call we don't tee errors to state naturally (e.g. via a Call Client function such as startVideo).\n // We do not have a stopLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.\n context.withErrorTeedToState(\n () => disposeViewUnparentedVideo(context, internalContext, stream),\n 'Call.stopVideo'\n )();\n } else {\n _logStreamEvent(EventNames.DISPOSE_STREAM_INVALID_PARAMS, { streamType });\n return;\n }\n}\n\n/**\n * @private\n * Only stops videos that are tied to a Call.\n */\nexport function disposeAllViewsFromCall(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string\n): void {\n const remoteStreams = internalContext.getRemoteRenderInfoForCall(callId);\n if (remoteStreams) {\n for (const [participantKey, participantStreams] of remoteStreams.entries()) {\n for (const [_, remoteStreamAndRenderer] of participantStreams.entries()) {\n // We don't want to accept SDK stream as parameter but we also don't cache the declarative stream so we have to\n // convert the SDK stream to declarative stream which is not pretty so this could use some further refactoring.\n disposeView(\n context,\n internalContext,\n callId,\n participantKey,\n convertSdkRemoteStreamToDeclarativeRemoteStream(remoteStreamAndRenderer.stream)\n );\n }\n }\n }\n\n const localStreams = internalContext.getLocalRenderInfosForCall(callId);\n if (localStreams) {\n for (const localStreamAndRenderer of localStreams.values()) {\n if (localStreamAndRenderer && localStreamAndRenderer.renderer) {\n // We don't want to accept SDK stream as parameter but we also don't cache the declarative stream so we have to\n // convert the SDK stream to declarative stream which is not pretty so this could use some further refactoring.\n disposeView(\n context,\n internalContext,\n callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localStreamAndRenderer.stream)\n );\n }\n }\n }\n}\n\n/**\n * @private\n */\nexport function disposeAllViews(context: CallContext, internalContext: InternalCallContext): void {\n const callIds = internalContext.getCallIds();\n for (const callId of callIds) {\n disposeAllViewsFromCall(context, internalContext, callId);\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"StreamUtils.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/StreamUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAEL,gBAAgB,EAEhB,mBAAmB,EAEpB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EACL,6CAA6C,EAC7C,+CAA+C,EAC/C,kDAAkD,EACnD,MAAM,aAAa,CAAC;AA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IAED,MAAM,YAAY,GAAG,eAAe,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC;IACxE,IAAI,YAAY,EAAE,CAAC;QACjB,KAAK,MAAM,sBAAsB,IAAI,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC;YAC3D,IAAI,sBAAsB,IAAI,sBAAsB,CAAC,QAAQ,EAAE,CAAC;gBAC9D,+GAA+G;gBAC/G,+GAA+G;gBAC/G,WAAW,CACT,OAAO,EACP,eAAe,EACf,MAAM,EACN,SAAS,EACT,6CAA6C,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAC7E,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IACD,gDAAgD;IAChD,MAAM,kBAAkB,GAAG,eAAe,CAAC,gCAAgC,CAAC,MAAM,CAAC,CAAC;IACpF,gDAAgD;IAChD,IAAI,kBAAkB,EAAE,CAAC;QACvB,KAAK,MAAM,cAAc,IAAI,kBAAkB,CAAC,MAAM,EAAE,EAAE,CAAC;YACzD,KAAK,MAAM,iBAAiB,IAAI,cAAc,CAAC,MAAM,EAAE,EAAE,CAAC;gBACxD,WAAW,CACT,OAAO,EACP,eAAe,EACf,MAAM,EACN,SAAS,EACT,+CAA+C,CAAC,iBAAiB,CAAC,MAA2B,CAAC,CAC/F,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,OAAoB,EAAE,eAAoC;IACxF,MAAM,OAAO,GAAG,eAAe,CAAC,UAAU,EAAE,CAAC;IAC7C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,uBAAuB,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n CreateViewOptions,\n LocalVideoStream,\n RemoteVideoStream,\n VideoStreamRenderer,\n VideoStreamRendererView\n} from '@azure/communication-calling';\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport { LocalVideoStreamState, RemoteVideoStreamState } from './CallClientState';\nimport { CallContext } from './CallContext';\nimport {\n convertSdkLocalStreamToDeclarativeLocalStream,\n convertSdkRemoteStreamToDeclarativeRemoteStream,\n convertFromSDKToDeclarativeVideoStreamRendererView\n} from './Converter';\nimport { InternalCallContext } from './InternalCallContext';\nimport { toFlatCommunicationIdentifier, _logEvent } from '@internal/acs-ui-common';\nimport { EventNames } from './Logger';\nimport { _logStreamEvent } from './StreamUtilsLogging';\n\n/**\n * Return result from {@link StatefulCallClient.createView}.\n *\n * @public\n */\nexport type CreateViewResult = {\n renderer: VideoStreamRenderer;\n view: VideoStreamRendererView;\n};\n\nasync function createViewVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string,\n stream?: RemoteVideoStreamState | LocalVideoStreamState,\n participantId?: CommunicationIdentifierKind | string,\n options?: CreateViewOptions\n): Promise<CreateViewResult | undefined> {\n // we can only have 3 types of createView\n let streamEventType: 'createViewLocal' | 'createViewRemote' | 'createViewUnparented';\n\n // we will reuse these for local as well but we need to make sure the remote stream is passed in like before.\n\n if (participantId) {\n streamEventType = 'createViewRemote';\n } else if (callId) {\n streamEventType = 'createViewLocal';\n } else {\n // TODO update for when unparented view.\n throw new Error('unparented createView not implemented yet here');\n streamEventType = 'createViewUnparented';\n }\n\n const streamType = stream?.mediaStreamType;\n const localStreamKey = (stream as LocalVideoStream).mediaStreamType;\n const remoteStreamId = (stream as RemoteVideoStream).id;\n\n // we want to check to see if there is a participantId this will tell us whether its a local stream or a remote one.\n const participantKey =\n streamEventType === 'createViewRemote' && participantId\n ? typeof participantId === 'string'\n ? participantId\n : toFlatCommunicationIdentifier(participantId)\n : undefined;\n\n const streamLogInfo = {\n callId,\n participantKey,\n streamId: remoteStreamId ?? localStreamKey,\n streamType,\n streamEventType\n };\n\n // make different logging announcement based on whether or not we are starting a local or remote\n _logStreamEvent(EventNames.CREATING_VIEW, streamLogInfo);\n\n // if we have a participant Id and a stream get the remote info, else get the local render info from state.\n const renderInfo =\n streamEventType === 'createViewRemote' && participantKey\n ? internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, remoteStreamId)\n : internalContext.getLocalRenderInfo(callId, localStreamKey);\n\n if (!renderInfo) {\n _logStreamEvent(EventNames.STREAM_NOT_FOUND, streamLogInfo);\n return;\n }\n\n if (renderInfo.status === 'Rendered') {\n _logStreamEvent(EventNames.STREAM_ALREADY_RENDERED, streamLogInfo);\n return;\n }\n\n if (renderInfo.status === 'Rendering') {\n // Do not log to console here as this is a very common situation due to UI rerenders while\n // the video rendering is in progress.\n _logStreamEvent(EventNames.STREAM_RENDERING, streamLogInfo);\n return;\n }\n\n // \"Stopping\" only happens if the stream was in \"rendering\" but `disposeView` was called.\n // Now that `createView` has been re-called, we can flip the state back to \"rendering\".\n if (renderInfo.status === 'Stopping') {\n if (streamEventType === 'createViewRemote' && participantKey) {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n remoteStreamId,\n renderInfo.stream as RemoteVideoStream,\n 'Rendering',\n renderInfo.renderer\n );\n } else if (streamEventType === 'createViewLocal') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n internalContext.setLocalRenderInfo(\n callId,\n localStreamKey,\n renderInfo.stream as LocalVideoStream,\n 'Rendering',\n renderInfo.renderer\n );\n }\n return;\n }\n\n const renderer = new VideoStreamRenderer(renderInfo.stream);\n\n streamEventType === 'createViewRemote' && participantKey\n ? internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n remoteStreamId,\n renderInfo.stream as RemoteVideoStream,\n 'Rendering',\n undefined\n )\n : internalContext.setLocalRenderInfo(\n callId,\n localStreamKey,\n renderInfo.stream as LocalVideoStream,\n 'Rendering',\n renderer\n );\n\n let view;\n try {\n view = await renderer.createView(options);\n } catch (e) {\n if (streamEventType === 'createViewRemote' && participantKey) {\n _logStreamEvent(EventNames.CREATE_STREAM_FAIL, streamLogInfo);\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n remoteStreamId,\n renderInfo.stream as RemoteVideoStream,\n 'NotRendered',\n undefined\n );\n } else if (streamEventType === 'createViewLocal') {\n _logStreamEvent(EventNames.CREATE_STREAM_FAIL, streamLogInfo, e);\n internalContext.setLocalRenderInfo(\n callId,\n localStreamKey,\n renderInfo.stream as LocalVideoStream,\n 'NotRendered',\n undefined\n );\n }\n throw e;\n }\n\n // Since render could take some time, we need to check if the stream is still valid and if we received a signal to\n // stop rendering.\n const refreshedRenderInfo =\n streamEventType === 'createViewRemote' && participantKey\n ? internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, remoteStreamId)\n : internalContext.getLocalRenderInfo(callId, localStreamKey);\n\n if (!refreshedRenderInfo) {\n // RenderInfo was removed. This should not happen unless stream was removed from the call so dispose the renderer\n // and clean up the state.\n _logStreamEvent(EventNames.RENDER_INFO_NOT_FOUND, streamLogInfo);\n renderer.dispose();\n streamEventType === 'createViewRemote' && participantKey\n ? context.setRemoteVideoStreamRendererView(callId, participantKey, remoteStreamId, undefined)\n : context.setLocalVideoStreamRendererView(callId, localStreamKey, undefined);\n return;\n }\n\n if (refreshedRenderInfo.status === 'Stopping') {\n // Stop render was called on this stream after we had started rendering. We will dispose this view and do not\n // put the view into the state.\n streamEventType === 'createViewRemote';\n _logStreamEvent(EventNames.CREATED_STREAM_STOPPING, streamLogInfo);\n renderer.dispose();\n if (streamEventType === 'createViewRemote' && participantKey) {\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n remoteStreamId,\n refreshedRenderInfo.stream as RemoteVideoStream,\n 'NotRendered',\n undefined\n );\n context.setRemoteVideoStreamRendererView(callId, participantKey, remoteStreamId, undefined);\n } else if (streamEventType === 'createViewLocal') {\n internalContext.setLocalRenderInfo(\n callId,\n localStreamKey,\n refreshedRenderInfo.stream as LocalVideoStream,\n 'NotRendered',\n undefined\n );\n context.setLocalVideoStreamRendererView(callId, localStreamKey, undefined);\n }\n return;\n }\n\n // Else the stream still exists and status is not telling us to stop rendering. Complete the render process by\n // updating the state.\n if (streamEventType === 'createViewRemote' && participantKey) {\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n remoteStreamId,\n refreshedRenderInfo.stream as RemoteVideoStream,\n 'Rendered',\n renderer\n );\n context.setRemoteVideoStreamRendererView(\n callId,\n participantKey,\n remoteStreamId,\n convertFromSDKToDeclarativeVideoStreamRendererView(view)\n );\n _logStreamEvent(EventNames.VIEW_RENDER_SUCCEED, streamLogInfo);\n } else if (streamEventType === 'createViewLocal') {\n internalContext.setLocalRenderInfo(\n callId,\n localStreamKey,\n refreshedRenderInfo.stream as LocalVideoStream,\n 'Rendered',\n renderer\n );\n context.setLocalVideoStreamRendererView(\n callId,\n localStreamKey,\n convertFromSDKToDeclarativeVideoStreamRendererView(view)\n );\n _logStreamEvent(EventNames.VIEW_RENDER_SUCCEED, streamLogInfo);\n }\n\n return {\n renderer,\n view\n };\n}\n\nasync function createViewUnparentedVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n stream: LocalVideoStreamState,\n options?: CreateViewOptions\n): Promise<CreateViewResult | undefined> {\n const renderInfo = internalContext.getUnparentedRenderInfo(stream);\n\n if (renderInfo && renderInfo.status === 'Rendered') {\n console.warn('Unparented LocalVideoStream is already rendered');\n return;\n }\n\n if (renderInfo && renderInfo.status === 'Rendering') {\n // Do not log to console here as this is a very common situation due to UI rerenders while\n // the video rendering is in progress.\n return;\n }\n\n if (renderInfo && renderInfo.status === 'Stopping') {\n console.warn('Unparented LocalVideoStream is in the middle of stopping');\n return;\n }\n\n const localVideoStream = new LocalVideoStream(stream.source);\n const renderer = new VideoStreamRenderer(localVideoStream);\n\n internalContext.setUnparentedRenderInfo(stream, localVideoStream, 'Rendering', undefined);\n\n let view: VideoStreamRendererView;\n try {\n view = await renderer.createView(options);\n } catch (e) {\n // Special case for unparented views. Since they are not tied to anything and created by us based on the calls to\n // this function we'll delete it to clean up the data since keeping it around doesn't help us and if developer wants\n // to create a new view they can check that the view is not rendered and call this function again.\n internalContext.deleteUnparentedRenderInfo(stream);\n throw e;\n }\n\n // Since render could take some time, we need to check if the stream is still valid and if we received a signal to\n // stop rendering.\n const refreshedRenderInfo = internalContext.getUnparentedRenderInfo(stream);\n if (!refreshedRenderInfo) {\n // Unparented stream's RenderInfo was deleted. Currently this shouldn't happen but if it does we'll just dispose the\n // renderer and clean up state. If developer wanted the stream they could call this function again and that should\n // generate new working state via this function.\n renderer.dispose();\n context.deleteDeviceManagerUnparentedView(stream);\n return;\n }\n\n if (refreshedRenderInfo.status === 'Stopping') {\n // Stop render was called on this stream after we had started rendering. We will dispose this view and do not\n // put the view into the state. Special case for unparented views, delete them from state when stopped to free up\n // the memory since we were the ones generating this and not tied to any Call state.\n internalContext.deleteUnparentedRenderInfo(stream);\n context.deleteDeviceManagerUnparentedView(stream);\n return;\n }\n // Else the stream still exists and status is not telling us to stop rendering. Complete the render process by\n // updating the state.\n internalContext.setUnparentedRenderInfo(stream, localVideoStream, 'Rendered', renderer);\n internalContext.subscribeToUnparentedViewVideoEffects(localVideoStream, context);\n context.setDeviceManagerUnparentedView(stream, convertFromSDKToDeclarativeVideoStreamRendererView(view));\n\n return {\n renderer,\n view\n };\n}\n\nfunction disposeViewVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string,\n stream: RemoteVideoStreamState | LocalVideoStreamState,\n participantId?: CommunicationIdentifierKind | string\n): void {\n // we can only have 3 types of createView\n let streamEventType: 'disposeViewLocal' | 'disposeViewRemote' | 'disposeViewUnparented';\n\n // we will reuse these for local as well but we need to make sure the remote stream is passed in like before.\n\n if (participantId) {\n streamEventType = 'disposeViewRemote';\n } else if (callId) {\n streamEventType = 'disposeViewLocal';\n } else {\n // TODO update for when unparented view.\n streamEventType = 'disposeViewUnparented';\n }\n\n const streamType = stream.mediaStreamType;\n const localStreamKey = (stream as LocalVideoStream).mediaStreamType;\n const remoteStreamId = (stream as RemoteVideoStream).id;\n\n // we want to check to see if there is a participantId this will tell us whether its a local stream or a remote one.\n const participantKey =\n streamEventType === 'disposeViewRemote' && participantId\n ? typeof participantId === 'string'\n ? participantId\n : toFlatCommunicationIdentifier(participantId)\n : undefined;\n const streamLogInfo = { callId, participantKey, streamId: remoteStreamId ?? localStreamKey, streamType };\n\n _logStreamEvent(EventNames.START_DISPOSE_STREAM, streamLogInfo);\n\n if (streamEventType === 'disposeViewRemote' && participantKey) {\n context.setRemoteVideoStreamRendererView(callId, participantKey, remoteStreamId, undefined);\n }\n\n const renderInfo =\n streamEventType === 'disposeViewRemote' && participantKey\n ? internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, remoteStreamId)\n : internalContext.getLocalRenderInfo(callId, localStreamKey);\n\n if (!renderInfo) {\n _logStreamEvent(EventNames.DISPOSE_INFO_NOT_FOUND, streamLogInfo);\n return;\n }\n\n // Nothing to dispose of or clean up -- we can safely exit early here.\n if (renderInfo.status === 'NotRendered') {\n _logStreamEvent(EventNames.STREAM_ALREADY_DISPOSED, streamLogInfo);\n return;\n }\n\n // Status is already marked as \"stopping\" so we can exit early here. This is because stopping only occurs\n // when the stream is being created in createView but hasn't been completed being created yet. The createView\n // method will see the \"stopping\" status and perform the cleanup\n if (renderInfo.status === 'Stopping') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n return;\n }\n\n // If the stream is in the middle of being rendered (i.e. has state \"Rendering\"), we need the status as\n // \"stopping\" without performing any cleanup. This will tell the `createView` method that it should stop\n // rendering and clean up the state once the view has finished being created.\n if (renderInfo.status === 'Rendering') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n streamEventType === 'disposeViewRemote' && participantKey\n ? internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n remoteStreamId,\n renderInfo.stream as RemoteVideoStream,\n 'Stopping',\n undefined\n )\n : internalContext.setLocalRenderInfo(\n callId,\n localStreamKey,\n renderInfo.stream as LocalVideoStream,\n 'Stopping',\n renderInfo.renderer\n );\n return;\n }\n\n if (renderInfo.renderer) {\n _logStreamEvent(EventNames.DISPOSING_RENDERER, streamLogInfo);\n renderInfo.renderer.dispose();\n // Else the state must be in the \"Rendered\" state, so we can dispose the renderer and clean up the state.\n if (streamEventType === 'disposeViewRemote' && participantKey) {\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n remoteStreamId,\n renderInfo.stream as RemoteVideoStream,\n 'NotRendered',\n undefined\n );\n } else if (streamEventType === 'disposeViewLocal') {\n internalContext.setLocalRenderInfo(\n callId,\n localStreamKey,\n renderInfo.stream as LocalVideoStream,\n 'NotRendered',\n undefined\n );\n context.setLocalVideoStreamRendererView(callId, localStreamKey, undefined);\n }\n } else {\n _logStreamEvent(EventNames.RENDERER_NOT_FOUND, streamLogInfo);\n }\n}\n\nfunction disposeViewUnparentedVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n stream: LocalVideoStreamState\n): void {\n const streamType = stream.mediaStreamType;\n const streamLogInfo = { streamType, streamEventType: 'disposeViewUnparented' };\n\n _logStreamEvent(EventNames.START_DISPOSE_STREAM, streamLogInfo);\n\n context.deleteDeviceManagerUnparentedView(stream);\n\n const renderInfo = internalContext.getUnparentedRenderInfo(stream);\n if (!renderInfo) {\n _logStreamEvent(EventNames.DISPOSE_INFO_NOT_FOUND, streamLogInfo);\n return;\n }\n\n if (renderInfo.status === 'Rendering') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n internalContext.setUnparentedRenderInfo(stream, renderInfo.stream, 'Stopping', undefined);\n } else {\n internalContext.deleteUnparentedRenderInfo(stream);\n }\n\n if (renderInfo.renderer) {\n _logStreamEvent(EventNames.DISPOSING_RENDERER, streamLogInfo);\n renderInfo.renderer.dispose();\n } else {\n _logStreamEvent(EventNames.RENDERER_NOT_FOUND, streamLogInfo);\n }\n}\n\n/**\n * @private\n */\nexport function createView(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string | undefined,\n participantId: CommunicationIdentifierKind | string | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState,\n options?: CreateViewOptions\n): Promise<CreateViewResult | undefined> {\n const streamType = stream.mediaStreamType;\n\n if (callId) {\n return createViewVideo(context, internalContext, callId, stream, participantId, options);\n } else if (!('id' in stream) && !callId) {\n // Render LocalVideoStream that is not part of a Call\n // Because it is not part of the call we don't tee errors to state naturally (e.g. via a Call Client function such as startVideo).\n // We do not have a startLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.\n return context.withAsyncErrorTeedToState(\n async () => await createViewUnparentedVideo(context, internalContext, stream, options),\n 'Call.startVideo'\n )();\n } else {\n _logStreamEvent(EventNames.CREATE_STREAM_INVALID_PARAMS, { streamType });\n return Promise.resolve(undefined);\n }\n}\n\n/**\n * @private\n */\nexport function disposeView(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string | undefined,\n participantId: CommunicationIdentifierKind | string | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState\n): void {\n const streamType = stream.mediaStreamType;\n if (callId) {\n disposeViewVideo(context, internalContext, callId, stream, participantId);\n } else if (!('id' in stream) && !callId) {\n // Stop rendering LocalVideoStream that is not part of a Call\n // Because it is not part of the call we don't tee errors to state naturally (e.g. via a Call Client function such as startVideo).\n // We do not have a stopLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.\n context.withErrorTeedToState(\n () => disposeViewUnparentedVideo(context, internalContext, stream),\n 'Call.stopVideo'\n )();\n } else {\n _logStreamEvent(EventNames.DISPOSE_STREAM_INVALID_PARAMS, { streamType });\n return;\n }\n}\n\n/**\n * @private\n * Only stops videos that are tied to a Call.\n */\nexport function disposeAllViewsFromCall(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string\n): void {\n const remoteStreams = internalContext.getRemoteRenderInfoForCall(callId);\n if (remoteStreams) {\n for (const [participantKey, participantStreams] of remoteStreams.entries()) {\n for (const [_, remoteStreamAndRenderer] of participantStreams.entries()) {\n // We don't want to accept SDK stream as parameter but we also don't cache the declarative stream so we have to\n // convert the SDK stream to declarative stream which is not pretty so this could use some further refactoring.\n disposeView(\n context,\n internalContext,\n callId,\n participantKey,\n convertSdkRemoteStreamToDeclarativeRemoteStream(remoteStreamAndRenderer.stream)\n );\n }\n }\n }\n\n const localStreams = internalContext.getLocalRenderInfosForCall(callId);\n if (localStreams) {\n for (const localStreamAndRenderer of localStreams.values()) {\n if (localStreamAndRenderer && localStreamAndRenderer.renderer) {\n // We don't want to accept SDK stream as parameter but we also don't cache the declarative stream so we have to\n // convert the SDK stream to declarative stream which is not pretty so this could use some further refactoring.\n disposeView(\n context,\n internalContext,\n callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localStreamAndRenderer.stream)\n );\n }\n }\n }\n /* @conditional-compile-remove(together-mode) */\n const callFeatureStreams = internalContext.getCallFeatureRenderInfosForCall(callId);\n /* @conditional-compile-remove(together-mode) */\n if (callFeatureStreams) {\n for (const featureStreams of callFeatureStreams.values()) {\n for (const streamAndRenderer of featureStreams.values()) {\n disposeView(\n context,\n internalContext,\n callId,\n undefined,\n convertSdkRemoteStreamToDeclarativeRemoteStream(streamAndRenderer.stream as RemoteVideoStream)\n );\n }\n }\n }\n}\n\n/**\n * @private\n */\nexport function disposeAllViews(context: CallContext, internalContext: InternalCallContext): void {\n const callIds = internalContext.getCallIds();\n for (const callId of callIds) {\n disposeAllViewsFromCall(context, internalContext, callId);\n }\n}\n"]}
|
@@ -1,19 +1,24 @@
|
|
1
1
|
import { TogetherModeCallFeature } from '@azure/communication-calling';
|
2
2
|
import { CallContext } from './CallContext';
|
3
3
|
import { CallIdRef } from './CallIdRef';
|
4
|
-
|
5
|
-
* @private
|
6
|
-
*/
|
4
|
+
import { InternalCallContext } from './InternalCallContext';
|
7
5
|
/**
|
8
6
|
* TogetherModeSubscriber is responsible for subscribing to together mode events and updating the call context accordingly.
|
9
7
|
*/
|
10
8
|
export declare class TogetherModeSubscriber {
|
11
9
|
private _callIdRef;
|
12
10
|
private _context;
|
11
|
+
private _internalContext;
|
13
12
|
private _togetherMode;
|
14
|
-
|
13
|
+
private _featureName;
|
14
|
+
private _togetherModeVideoStreamSubscribers;
|
15
|
+
constructor(callIdRef: CallIdRef, context: CallContext, internalContext: InternalCallContext, togetherMode: TogetherModeCallFeature);
|
15
16
|
private subscribe;
|
16
17
|
unsubscribe: () => void;
|
18
|
+
private onSceneUpdated;
|
19
|
+
private onSeatUpdated;
|
20
|
+
private addRemoteVideoStreamSubscriber;
|
21
|
+
private updateTogetherModeStreams;
|
17
22
|
private onTogetherModeStreamUpdated;
|
18
23
|
}
|
19
24
|
//# sourceMappingURL=TogetherModeSubscriber.d.ts.map
|
@@ -1,31 +1,60 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT License.
|
3
|
-
|
4
|
-
|
5
|
-
*/
|
3
|
+
/* @conditional-compile-remove(together-mode) */
|
4
|
+
import { disposeView } from './CallFeatureStreamUtils';
|
5
|
+
/* @conditional-compile-remove(together-mode) */
|
6
|
+
import { convertSdkCallFeatureStreamToDeclarativeCallFeatureStream } from './Converter';
|
7
|
+
/* @conditional-compile-remove(together-mode) */
|
8
|
+
import { TogetherModeVideoStreamSubscriber } from './TogetherModeVideoStreamSubscriber';
|
6
9
|
/* @conditional-compile-remove(together-mode) */
|
7
10
|
/**
|
8
11
|
* TogetherModeSubscriber is responsible for subscribing to together mode events and updating the call context accordingly.
|
9
12
|
*/
|
10
13
|
export class TogetherModeSubscriber {
|
11
|
-
constructor(callIdRef, context, togetherMode) {
|
14
|
+
constructor(callIdRef, context, internalContext, togetherMode) {
|
15
|
+
this._featureName = 'togetherMode';
|
12
16
|
this.subscribe = () => {
|
13
17
|
this._togetherMode.on('togetherModeStreamsUpdated', this.onTogetherModeStreamUpdated);
|
18
|
+
this._togetherMode.on('togetherModeSceneUpdated', this.onSceneUpdated);
|
19
|
+
this._togetherMode.on('togetherModeSeatingUpdated', this.onSeatUpdated);
|
14
20
|
};
|
15
21
|
this.unsubscribe = () => {
|
16
22
|
this._togetherMode.off('togetherModeStreamsUpdated', this.onTogetherModeStreamUpdated);
|
23
|
+
this._togetherMode.off('togetherModeSceneUpdated', this.onSceneUpdated);
|
24
|
+
this._togetherMode.off('togetherModeSeatingUpdated', this.onSeatUpdated);
|
17
25
|
};
|
18
|
-
this.
|
19
|
-
|
20
|
-
|
26
|
+
this.onSceneUpdated = (args) => {
|
27
|
+
this._context.setTogetherModeSeatingCoordinates(this._callIdRef.callId, args);
|
28
|
+
};
|
29
|
+
this.onSeatUpdated = (args) => {
|
30
|
+
this._context.setTogetherModeSeatingCoordinates(this._callIdRef.callId, args);
|
31
|
+
};
|
32
|
+
this.addRemoteVideoStreamSubscriber = (togetherModeVideoStream) => {
|
33
|
+
var _a;
|
34
|
+
(_a = this._togetherModeVideoStreamSubscribers.get(togetherModeVideoStream.id)) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
35
|
+
this._togetherModeVideoStreamSubscribers.set(togetherModeVideoStream.id, new TogetherModeVideoStreamSubscriber(this._callIdRef, togetherModeVideoStream, this._context));
|
36
|
+
};
|
37
|
+
this.updateTogetherModeStreams = (addedStreams, removedStreams) => {
|
38
|
+
var _a;
|
39
|
+
for (const stream of removedStreams) {
|
40
|
+
(_a = this._togetherModeVideoStreamSubscribers.get(stream.id)) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
41
|
+
disposeView(this._context, this._internalContext, this._callIdRef.callId, convertSdkCallFeatureStreamToDeclarativeCallFeatureStream(stream, this._featureName));
|
42
|
+
this._internalContext.deleteCallFeatureRenderInfo(this._callIdRef.callId, this._featureName, stream.mediaStreamType);
|
21
43
|
}
|
22
|
-
|
23
|
-
this.
|
44
|
+
for (const stream of addedStreams) {
|
45
|
+
this._internalContext.setCallFeatureRenderInfo(this._callIdRef.callId, this._featureName, stream.mediaStreamType, stream, 'NotRendered', undefined);
|
46
|
+
this.addRemoteVideoStreamSubscriber(stream);
|
24
47
|
}
|
48
|
+
this._context.setTogetherModeVideoStreams(this._callIdRef.callId, addedStreams.map((stream) => convertSdkCallFeatureStreamToDeclarativeCallFeatureStream(stream, this._featureName)), removedStreams.map((stream) => convertSdkCallFeatureStreamToDeclarativeCallFeatureStream(stream, this._featureName)));
|
49
|
+
};
|
50
|
+
this.onTogetherModeStreamUpdated = (args) => {
|
51
|
+
this.updateTogetherModeStreams(args.added, args.removed);
|
25
52
|
};
|
26
53
|
this._callIdRef = callIdRef;
|
27
54
|
this._context = context;
|
55
|
+
this._internalContext = internalContext;
|
28
56
|
this._togetherMode = togetherMode;
|
57
|
+
this._togetherModeVideoStreamSubscribers = new Map();
|
29
58
|
this.subscribe();
|
30
59
|
}
|
31
60
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TogetherModeSubscriber.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/TogetherModeSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
1
|
+
{"version":3,"file":"TogetherModeSubscriber.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/TogetherModeSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAelC,gDAAgD;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,gDAAgD;AAChD,OAAO,EAAE,yDAAyD,EAAE,MAAM,aAAa,CAAC;AACxF,gDAAgD;AAChD,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AAGxF,gDAAgD;AAChD;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAQjC,YACE,SAAoB,EACpB,OAAoB,EACpB,eAAoC,EACpC,YAAqC;QAP/B,iBAAY,GAA0B,cAAc,CAAC;QAiBrD,cAAS,GAAG,GAAS,EAAE;YAC7B,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,4BAA4B,EAAE,IAAI,CAAC,2BAA2B,CAAC,CAAC;YACtF,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,0BAA0B,E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CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,mCAAmC,GAAG,IAAI,GAAG,EAA6C,CAAC;QAChG,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;CA6EF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(together-mode) */\nimport {\n RemoteVideoStream,\n TogetherModeCallFeature,\n TogetherModeSeatingMap,\n TogetherModeVideoStream\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(together-mode) */\nimport { CallContext } from './CallContext';\n/* @conditional-compile-remove(together-mode) */\nimport { CallIdRef } from './CallIdRef';\n/* @conditional-compile-remove(together-mode) */\nimport { InternalCallContext } from './InternalCallContext';\n/* @conditional-compile-remove(together-mode) */\nimport { disposeView } from './CallFeatureStreamUtils';\n/* @conditional-compile-remove(together-mode) */\nimport { convertSdkCallFeatureStreamToDeclarativeCallFeatureStream } from './Converter';\n/* @conditional-compile-remove(together-mode) */\nimport { TogetherModeVideoStreamSubscriber } from './TogetherModeVideoStreamSubscriber';\n/* @conditional-compile-remove(together-mode) */\nimport { CallFeatureStreamName } from './CallClientState';\n/* @conditional-compile-remove(together-mode) */\n/**\n * TogetherModeSubscriber is responsible for subscribing to together mode events and updating the call context accordingly.\n */\nexport class TogetherModeSubscriber {\n private _callIdRef: CallIdRef;\n private _context: CallContext;\n private _internalContext: InternalCallContext;\n private _togetherMode: TogetherModeCallFeature;\n private _featureName: CallFeatureStreamName = 'togetherMode';\n private _togetherModeVideoStreamSubscribers: Map<number, TogetherModeVideoStreamSubscriber>;\n\n constructor(\n callIdRef: CallIdRef,\n context: CallContext,\n internalContext: InternalCallContext,\n togetherMode: TogetherModeCallFeature\n ) {\n this._callIdRef = callIdRef;\n this._context = context;\n this._internalContext = internalContext;\n this._togetherMode = togetherMode;\n this._togetherModeVideoStreamSubscribers = new Map<number, TogetherModeVideoStreamSubscriber>();\n this.subscribe();\n }\n\n private subscribe = (): void => {\n this._togetherMode.on('togetherModeStreamsUpdated', this.onTogetherModeStreamUpdated);\n this._togetherMode.on('togetherModeSceneUpdated', this.onSceneUpdated);\n this._togetherMode.on('togetherModeSeatingUpdated', this.onSeatUpdated);\n };\n\n public unsubscribe = (): void => {\n this._togetherMode.off('togetherModeStreamsUpdated', this.onTogetherModeStreamUpdated);\n this._togetherMode.off('togetherModeSceneUpdated', this.onSceneUpdated);\n this._togetherMode.off('togetherModeSeatingUpdated', this.onSeatUpdated);\n };\n\n private onSceneUpdated = (args: TogetherModeSeatingMap): void => {\n this._context.setTogetherModeSeatingCoordinates(this._callIdRef.callId, args);\n };\n\n private onSeatUpdated = (args: TogetherModeSeatingMap): void => {\n this._context.setTogetherModeSeatingCoordinates(this._callIdRef.callId, args);\n };\n\n private addRemoteVideoStreamSubscriber = (togetherModeVideoStream: TogetherModeVideoStream): void => {\n this._togetherModeVideoStreamSubscribers.get(togetherModeVideoStream.id)?.unsubscribe();\n this._togetherModeVideoStreamSubscribers.set(\n togetherModeVideoStream.id,\n new TogetherModeVideoStreamSubscriber(this._callIdRef, togetherModeVideoStream, this._context)\n );\n };\n\n private updateTogetherModeStreams = (\n addedStreams: TogetherModeVideoStream[],\n removedStreams: TogetherModeVideoStream[]\n ): void => {\n for (const stream of removedStreams) {\n this._togetherModeVideoStreamSubscribers.get(stream.id)?.unsubscribe();\n disposeView(\n this._context,\n this._internalContext,\n this._callIdRef.callId,\n convertSdkCallFeatureStreamToDeclarativeCallFeatureStream(stream, this._featureName)\n );\n this._internalContext.deleteCallFeatureRenderInfo(\n this._callIdRef.callId,\n this._featureName,\n stream.mediaStreamType\n );\n }\n\n for (const stream of addedStreams) {\n this._internalContext.setCallFeatureRenderInfo(\n this._callIdRef.callId,\n this._featureName,\n stream.mediaStreamType,\n stream as RemoteVideoStream,\n 'NotRendered',\n undefined\n );\n this.addRemoteVideoStreamSubscriber(stream);\n }\n this._context.setTogetherModeVideoStreams(\n this._callIdRef.callId,\n addedStreams.map((stream) =>\n convertSdkCallFeatureStreamToDeclarativeCallFeatureStream(stream, this._featureName)\n ),\n removedStreams.map((stream) =>\n convertSdkCallFeatureStreamToDeclarativeCallFeatureStream(stream, this._featureName)\n )\n );\n };\n\n private onTogetherModeStreamUpdated = (args: {\n added: TogetherModeVideoStream[];\n removed: TogetherModeVideoStream[];\n }): void => {\n this.updateTogetherModeStreams(args.added, args.removed);\n };\n}\n"]}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { TogetherModeVideoStream } from '@azure/communication-calling';
|
2
|
+
import { CallContext } from './CallContext';
|
3
|
+
import { CallIdRef } from './CallIdRef';
|
4
|
+
/**
|
5
|
+
* @private
|
6
|
+
*/
|
7
|
+
export declare class TogetherModeVideoStreamSubscriber {
|
8
|
+
private _callIdRef;
|
9
|
+
private _togetherModeStream;
|
10
|
+
private _context;
|
11
|
+
constructor(callIdRef: CallIdRef, stream: TogetherModeVideoStream, context: CallContext);
|
12
|
+
private subscribe;
|
13
|
+
unsubscribe: () => void;
|
14
|
+
private isAvailableChanged;
|
15
|
+
private isReceivingChanged;
|
16
|
+
private isSizeChanged;
|
17
|
+
}
|
18
|
+
//# sourceMappingURL=TogetherModeVideoStreamSubscriber.d.ts.map
|
@@ -0,0 +1,34 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT License.
|
3
|
+
/* @conditional-compile-remove(together-mode) */
|
4
|
+
/**
|
5
|
+
* @private
|
6
|
+
*/
|
7
|
+
export class TogetherModeVideoStreamSubscriber {
|
8
|
+
constructor(callIdRef, stream, context) {
|
9
|
+
this.subscribe = () => {
|
10
|
+
this._togetherModeStream.on('isAvailableChanged', this.isAvailableChanged);
|
11
|
+
this._togetherModeStream.on('isReceivingChanged', this.isReceivingChanged);
|
12
|
+
this._togetherModeStream.on('sizeChanged', this.isSizeChanged);
|
13
|
+
};
|
14
|
+
this.unsubscribe = () => {
|
15
|
+
this._togetherModeStream.off('isAvailableChanged', this.isAvailableChanged);
|
16
|
+
this._togetherModeStream.off('isReceivingChanged', this.isReceivingChanged);
|
17
|
+
this._togetherModeStream.off('sizeChanged', this.isSizeChanged);
|
18
|
+
};
|
19
|
+
this.isAvailableChanged = () => {
|
20
|
+
this._context.setTogetherModeVideoStreamIsAvailable(this._callIdRef.callId, this._togetherModeStream.id, this._togetherModeStream.isAvailable);
|
21
|
+
};
|
22
|
+
this.isReceivingChanged = () => {
|
23
|
+
this._context.setTogetherModeVideoStreamIsReceiving(this._callIdRef.callId, this._togetherModeStream.id, this._togetherModeStream.isReceiving);
|
24
|
+
};
|
25
|
+
this.isSizeChanged = () => {
|
26
|
+
this._context.setTogetherModeVideoStreamSize(this._callIdRef.callId, this._togetherModeStream.id, this._togetherModeStream.size);
|
27
|
+
};
|
28
|
+
this._callIdRef = callIdRef;
|
29
|
+
this._togetherModeStream = stream;
|
30
|
+
this._context = context;
|
31
|
+
this.subscribe();
|
32
|
+
}
|
33
|
+
}
|
34
|
+
//# sourceMappingURL=TogetherModeVideoStreamSubscriber.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TogetherModeVideoStreamSubscriber.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/TogetherModeVideoStreamSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,gDAAgD;AAChD;;GAEG;AACH,MAAM,OAAO,iCAAiC;IAK5C,YAAY,SAAoB,EAAE,MAA+B,EAAE,OAAoB;QAO/E,cAAS,GAAG,GAAS,EAAE;YAC7B,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,oBAAoB,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;YAC3E,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,oBAAoB,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;YAC3E,I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,CAAC;IACnB,CAAC;CAqCF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(together-mode) */\nimport { TogetherModeVideoStream } from '@azure/communication-calling';\n/* @conditional-compile-remove(together-mode) */\nimport { CallContext } from './CallContext';\n/* @conditional-compile-remove(together-mode) */\nimport { CallIdRef } from './CallIdRef';\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * @private\n */\nexport class TogetherModeVideoStreamSubscriber {\n private _callIdRef: CallIdRef;\n private _togetherModeStream: TogetherModeVideoStream;\n private _context: CallContext;\n\n constructor(callIdRef: CallIdRef, stream: TogetherModeVideoStream, context: CallContext) {\n this._callIdRef = callIdRef;\n this._togetherModeStream = stream;\n this._context = context;\n this.subscribe();\n }\n\n private subscribe = (): void => {\n this._togetherModeStream.on('isAvailableChanged', this.isAvailableChanged);\n this._togetherModeStream.on('isReceivingChanged', this.isReceivingChanged);\n this._togetherModeStream.on('sizeChanged', this.isSizeChanged);\n };\n\n public unsubscribe = (): void => {\n this._togetherModeStream.off('isAvailableChanged', this.isAvailableChanged);\n this._togetherModeStream.off('isReceivingChanged', this.isReceivingChanged);\n this._togetherModeStream.off('sizeChanged', this.isSizeChanged);\n };\n\n private isAvailableChanged = (): void => {\n this._context.setTogetherModeVideoStreamIsAvailable(\n this._callIdRef.callId,\n this._togetherModeStream.id,\n this._togetherModeStream.isAvailable\n );\n };\n\n private isReceivingChanged = (): void => {\n this._context.setTogetherModeVideoStreamIsReceiving(\n this._callIdRef.callId,\n this._togetherModeStream.id,\n this._togetherModeStream.isReceiving\n );\n };\n\n private isSizeChanged = (): void => {\n this._context.setTogetherModeVideoStreamSize(\n this._callIdRef.callId,\n this._togetherModeStream.id,\n this._togetherModeStream.size\n );\n };\n}\n"]}
|
@@ -8,7 +8,7 @@ export type { RemoteDiagnosticState, RemoteDiagnosticType } from './CallClientSt
|
|
8
8
|
export type { CreateViewResult } from './StreamUtils';
|
9
9
|
export type { RaiseHandCallFeatureState as RaiseHandCallFeature } from './CallClientState';
|
10
10
|
export type { TogetherModeCallFeatureState as TogetherModeCallFeature } from './CallClientState';
|
11
|
-
export type {
|
11
|
+
export type { CallFeatureStreamState, TogetherModeSeatingPositionState, CallFeatureStreamName, TogetherModeStreamsState, TogetherModeParticipantSeatingState } from './CallClientState';
|
12
12
|
export type { RaisedHandState } from './CallClientState';
|
13
13
|
export type { DeclarativeCallAgent, IncomingCallManagement } from './CallAgentDeclarative';
|
14
14
|
export type { DeclarativeTeamsCallAgent } from './TeamsCallAgentDeclarative';
|
@@ -24,4 +24,5 @@ export type { SpotlightCallFeatureState, SpotlightState } from './CallClientStat
|
|
24
24
|
export type { LocalRecordingCallFeatureState } from './CallClientState';
|
25
25
|
export type { ConferencePhoneInfo } from './CallClientState';
|
26
26
|
export type { BreakoutRoomsState } from './CallClientState';
|
27
|
+
export type { MediaAccessState } from './CallClientState';
|
27
28
|
//# sourceMappingURL=index-public.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-public.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/index-public.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { createStatefulCallClient } from './StatefulCallClient';\nexport type { StatefulCallClient, StatefulCallClientArgs, StatefulCallClientOptions } from './StatefulCallClient';\nexport type { StatefulDeviceManager } from './DeviceManagerDeclarative';\nexport type {\n CallAgentState,\n CallClientState,\n CallError,\n CallErrors,\n CallErrorTarget,\n CallState,\n DeviceManagerState,\n DiagnosticsCallFeatureState,\n IncomingCallState,\n LocalVideoStreamState,\n MediaDiagnosticsState,\n NetworkDiagnosticsState,\n RecordingCallFeatureState as RecordingCallFeature,\n RemoteParticipantState,\n RemoteVideoStreamState,\n TranscriptionCallFeatureState as TranscriptionCallFeature,\n VideoStreamRendererViewState,\n CallInfoState\n} from './CallClientState';\n/* @conditional-compile-remove(breakout-rooms) */\nexport type { CallNotification, CallNotifications, NotificationTarget } from './CallClientState';\nexport type { TeamsIncomingCallState } from './CallClientState';\n/* @conditional-compile-remove(remote-ufd) */\nexport type { RemoteDiagnosticState, RemoteDiagnosticType } from './CallClientState';\nexport type { CreateViewResult } from './StreamUtils';\nexport type { RaiseHandCallFeatureState as RaiseHandCallFeature } from './CallClientState';\n/* @conditional-compile-remove(together-mode) */\nexport type { TogetherModeCallFeatureState as TogetherModeCallFeature } from './CallClientState';\n/* @conditional-compile-remove(together-mode) */\nexport type {
|
1
|
+
{"version":3,"file":"index-public.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/index-public.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { createStatefulCallClient } from './StatefulCallClient';\nexport type { StatefulCallClient, StatefulCallClientArgs, StatefulCallClientOptions } from './StatefulCallClient';\nexport type { StatefulDeviceManager } from './DeviceManagerDeclarative';\nexport type {\n CallAgentState,\n CallClientState,\n CallError,\n CallErrors,\n CallErrorTarget,\n CallState,\n DeviceManagerState,\n DiagnosticsCallFeatureState,\n IncomingCallState,\n LocalVideoStreamState,\n MediaDiagnosticsState,\n NetworkDiagnosticsState,\n RecordingCallFeatureState as RecordingCallFeature,\n RemoteParticipantState,\n RemoteVideoStreamState,\n TranscriptionCallFeatureState as TranscriptionCallFeature,\n VideoStreamRendererViewState,\n CallInfoState\n} from './CallClientState';\n/* @conditional-compile-remove(breakout-rooms) */\nexport type { CallNotification, CallNotifications, NotificationTarget } from './CallClientState';\nexport type { TeamsIncomingCallState } from './CallClientState';\n/* @conditional-compile-remove(remote-ufd) */\nexport type { RemoteDiagnosticState, RemoteDiagnosticType } from './CallClientState';\nexport type { CreateViewResult } from './StreamUtils';\nexport type { RaiseHandCallFeatureState as RaiseHandCallFeature } from './CallClientState';\n/* @conditional-compile-remove(together-mode) */\nexport type { TogetherModeCallFeatureState as TogetherModeCallFeature } from './CallClientState';\n/* @conditional-compile-remove(together-mode) */\nexport type {\n CallFeatureStreamState,\n TogetherModeSeatingPositionState,\n CallFeatureStreamName,\n TogetherModeStreamsState,\n TogetherModeParticipantSeatingState\n} from './CallClientState';\n\nexport type { RaisedHandState } from './CallClientState';\nexport type { DeclarativeCallAgent, IncomingCallManagement } from './CallAgentDeclarative';\nexport type { DeclarativeTeamsCallAgent } from './TeamsCallAgentDeclarative';\nexport type { TeamsIncomingCallManagement } from './TeamsCallAgentDeclarative';\nexport type { LocalVideoStreamVideoEffectsState } from './CallClientState';\nexport type { CapabilitiesFeatureState } from './CallClientState';\nexport type { CaptionsCallFeatureState, CaptionsInfo } from './CallClientState';\nexport type { AcceptedTransfer, TransferFeatureState as TransferFeature } from './CallClientState';\nexport type { OptimalVideoCountFeatureState } from './CallClientState';\nexport type { PPTLiveCallFeatureState } from './CallClientState';\nexport type { ReactionState } from './CallClientState';\nexport type { SpotlightCallFeatureState, SpotlightState } from './CallClientState';\n/* @conditional-compile-remove(local-recording-notification) */\nexport type { LocalRecordingCallFeatureState } from './CallClientState';\nexport type { ConferencePhoneInfo } from './CallClientState';\n/* @conditional-compile-remove(breakout-rooms) */\nexport type { BreakoutRoomsState } from './CallClientState';\n/* @conditional-compile-remove(media-access) */\nexport type { MediaAccessState } from './CallClientState';\n"]}
|
@@ -40,11 +40,11 @@ export const _CaptionsBanner = (props) => {
|
|
40
40
|
scrollToBottom();
|
41
41
|
}
|
42
42
|
}, [captions, isAtBottomOfScroll]);
|
43
|
-
return (React.createElement(React.Fragment, null, startCaptionsInProgress && (React.createElement(FocusZone, {
|
44
|
-
isCaptionsOn && (React.createElement("
|
43
|
+
return (React.createElement(React.Fragment, null, startCaptionsInProgress && (React.createElement(FocusZone, { className: captionsContainerClassName, "data-ui-id": "captions-banner" },
|
44
|
+
isCaptionsOn && (React.createElement("ul", { ref: captionsScrollDivRef, className: (captionsOptions === null || captionsOptions === void 0 ? void 0 : captionsOptions.height) === 'full'
|
45
45
|
? captionsBannerFullHeightClassName(theme)
|
46
46
|
: captionsBannerClassName(formFactor), "data-ui-id": "captions-banner-inner" }, captions.map((caption) => {
|
47
|
-
return (React.createElement("
|
47
|
+
return (React.createElement("li", { key: caption.id, className: captionContainerClassName, "data-is-focusable": true },
|
48
48
|
React.createElement(_Caption, Object.assign({}, caption, { onRenderAvatar: onRenderAvatar }))));
|
49
49
|
}))),
|
50
50
|
!isCaptionsOn && (React.createElement(Stack, { verticalAlign: "center", styles: (captionsOptions === null || captionsOptions === void 0 ? void 0 : captionsOptions.height) === 'full'
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CaptionsBanner.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/CaptionsBanner.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,iCAAiC,EACjC,0BAA0B,EAC1B,6BAA6B,EAC7B,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AA+CjC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAe,EAAE;IAC1E,MAAM,EACJ,QAAQ,EACR,YAAY,EACZ,uBAAuB,EACvB,cAAc,EACd,OAAO,EACP,UAAU,GAAG,SAAS,EACtB,eAAe,EAChB,GAAG,KAAK,CAAC;IACV,MAAM,oBAAoB,GAAG,MAAM,
|
1
|
+
{"version":3,"file":"CaptionsBanner.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/CaptionsBanner.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,iCAAiC,EACjC,0BAA0B,EAC1B,6BAA6B,EAC7B,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AA+CjC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAe,EAAE;IAC1E,MAAM,EACJ,QAAQ,EACR,YAAY,EACZ,uBAAuB,EACvB,cAAc,EACd,OAAO,EACP,UAAU,GAAG,SAAS,EACtB,eAAe,EAChB,GAAG,KAAK,CAAC;IACV,MAAM,oBAAoB,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAC5D,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAU,IAAI,CAAC,CAAC;IAC5E,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,MAAM,cAAc,GAAG,GAAS,EAAE;QAChC,IAAI,oBAAoB,CAAC,OAAO,EAAE,CAAC;YACjC,oBAAoB,CAAC,OAAO,CAAC,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC;QACrF,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,uBAAuB,GAAG,WAAW,CAAC,GAAS,EAAE;QACrD,IAAI,CAAC,oBAAoB,CAAC,OAA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AC,CAAC,OAAO,EAAE,EAAE;YACxB,OAAO,CACL,4BAAI,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,yBAAyB,uBAAqB,IAAI;gBAChF,oBAAC,QAAQ,oBAAK,OAAO,IAAE,cAAc,EAAE,cAAc,IAAI,CACtD,CACN,CAAC;QACJ,CAAC,CAAC,CACC,CACN;QACA,CAAC,YAAY,IAAI,CAChB,oBAAC,KAAK,IACJ,aAAa,EAAC,QAAQ,EACtB,MAAM,EACJ,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,MAAK,MAAM;gBAChC,CAAC,CAAC,6BAA6B,CAAC,KAAK,CAAC;gBACtC,CAAC,CAAC,mBAAmB,CAAC,UAAU,CAAC,uBAElB,IAAI;YAEvB,oBAAC,OAAO,IAAC,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,yBAAyB,EAAE,QAAQ,EAAC,WAAW,EAAC,aAAa,EAAC,OAAO,GAAG,CAC3F,CACT,CACS,CACb,CACA,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { Stack, FocusZone, Spinner, useTheme } from '@fluentui/react';\nimport React, { useEffect, useRef, useState, useCallback } from 'react';\nimport { _Caption } from './Caption';\nimport {\n captionContainerClassName,\n captionsBannerClassName,\n captionsBannerFullHeightClassName,\n captionsContainerClassName,\n loadingBannerFullHeightStyles,\n loadingBannerStyles\n} from './styles/Captions.style';\nimport { OnRenderAvatarCallback } from '../types';\n\n/**\n * @internal\n * information required for each line of caption\n */\nexport type _CaptionsInfo = {\n id: string;\n displayName: string;\n captionText: string;\n userId?: string;\n};\n\n/**\n * @internal\n * strings for captions banner\n */\nexport interface _CaptionsBannerStrings {\n captionsBannerSpinnerText?: string;\n}\n\n/**\n * @internal\n * _CaptionsBanner Component Props.\n */\nexport interface _CaptionsBannerProps {\n captions: _CaptionsInfo[];\n isCaptionsOn?: boolean;\n startCaptionsInProgress?: boolean;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n strings?: _CaptionsBannerStrings;\n /**\n * Optional form factor for the component.\n * @defaultValue 'default'\n */\n formFactor?: 'default' | 'compact';\n captionsOptions?: {\n height: 'full' | 'default';\n };\n}\n\nconst SCROLL_OFFSET_ALLOWANCE = 20;\n\n/**\n * @internal\n * A component for displaying a CaptionsBanner with user icon, displayName and captions text.\n */\nexport const _CaptionsBanner = (props: _CaptionsBannerProps): JSX.Element => {\n const {\n captions,\n isCaptionsOn,\n startCaptionsInProgress,\n onRenderAvatar,\n strings,\n formFactor = 'default',\n captionsOptions\n } = props;\n const captionsScrollDivRef = useRef<HTMLUListElement>(null);\n const [isAtBottomOfScroll, setIsAtBottomOfScroll] = useState<boolean>(true);\n const theme = useTheme();\n\n const scrollToBottom = (): void => {\n if (captionsScrollDivRef.current) {\n captionsScrollDivRef.current.scrollTop = captionsScrollDivRef.current.scrollHeight;\n }\n };\n\n const handleScrollToTheBottom = useCallback((): void => {\n if (!captionsScrollDivRef.current) {\n return;\n }\n const atBottom =\n Math.ceil(captionsScrollDivRef.current.scrollTop) >=\n captionsScrollDivRef.current.scrollHeight - captionsScrollDivRef.current.clientHeight - SCROLL_OFFSET_ALLOWANCE;\n\n setIsAtBottomOfScroll(atBottom);\n }, []);\n\n useEffect(() => {\n const captionsScrollDiv = captionsScrollDivRef.current;\n captionsScrollDiv?.addEventListener('scroll', handleScrollToTheBottom);\n\n return () => {\n captionsScrollDiv?.removeEventListener('scroll', handleScrollToTheBottom);\n };\n }, [handleScrollToTheBottom, isCaptionsOn]);\n\n useEffect(() => {\n // only auto scroll to bottom is already is at bottom of scroll before new caption comes in\n if (isAtBottomOfScroll) {\n scrollToBottom();\n }\n }, [captions, isAtBottomOfScroll]);\n\n return (\n <>\n {startCaptionsInProgress && (\n <FocusZone className={captionsContainerClassName} data-ui-id=\"captions-banner\">\n {isCaptionsOn && (\n <ul\n ref={captionsScrollDivRef}\n className={\n captionsOptions?.height === 'full'\n ? captionsBannerFullHeightClassName(theme)\n : captionsBannerClassName(formFactor)\n }\n data-ui-id=\"captions-banner-inner\"\n >\n {captions.map((caption) => {\n return (\n <li key={caption.id} className={captionContainerClassName} data-is-focusable={true}>\n <_Caption {...caption} onRenderAvatar={onRenderAvatar} />\n </li>\n );\n })}\n </ul>\n )}\n {!isCaptionsOn && (\n <Stack\n verticalAlign=\"center\"\n styles={\n captionsOptions?.height === 'full'\n ? loadingBannerFullHeightStyles(theme)\n : loadingBannerStyles(formFactor)\n }\n data-is-focusable={true}\n >\n <Spinner label={strings?.captionsBannerSpinnerText} ariaLive=\"assertive\" labelPosition=\"right\" />\n </Stack>\n )}\n </FocusZone>\n )}\n </>\n );\n};\n"]}
|
@@ -248,7 +248,7 @@ export const ChatMessageComponentAsRichTextEditBox = (props) => {
|
|
248
248
|
errorBarType: SendBoxErrorBarType.error
|
249
249
|
}
|
250
250
|
: undefined }),
|
251
|
-
React.createElement(RichTextInputBoxComponent, { placeholderText: strings.editBoxPlaceholderText, onChange: onChangeHandler, editorComponentRef: editTextFieldRef, initialContent: initialContent, strings: richTextLocaleStrings, disabled: false, actionComponents: actionButtons, richTextEditorStyleProps: editBoxRichTextEditorStyle, isHorizontalLayoutDisabled: true,
|
251
|
+
React.createElement(RichTextInputBoxComponent, { placeholderText: strings.editBoxPlaceholderText, onChange: onChangeHandler, onEnterKeyDown: onSubmitHandler, editorComponentRef: editTextFieldRef, initialContent: initialContent, strings: richTextLocaleStrings, disabled: false, actionComponents: actionButtons, richTextEditorStyleProps: editBoxRichTextEditorStyle, isHorizontalLayoutDisabled: true,
|
252
252
|
/* @conditional-compile-remove(file-sharing-acs) */
|
253
253
|
onRenderAttachmentUploads: onRenderAttachmentUploads,
|
254
254
|
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|