@azure/communication-react 1.4.3-alpha-202212090014.0 → 1.4.3-alpha-202212130014.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/communication-react.d.ts +60 -2
  2. package/dist/dist-cjs/communication-react/index.js +218 -62
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/calling-stateful-client/src/VideoStreamRendererViewDeclarative.js +2 -3
  7. package/dist/dist-esm/calling-stateful-client/src/VideoStreamRendererViewDeclarative.js.map +1 -1
  8. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.d.ts +5 -4
  9. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +28 -5
  10. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  11. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.d.ts +5 -1
  12. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js +2 -2
  13. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.d.ts +14 -3
  15. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js +13 -10
  16. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.d.ts +2 -2
  18. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js +7 -2
  19. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js.map +1 -1
  20. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.d.ts +16 -0
  21. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +52 -0
  22. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -0
  23. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +9 -0
  24. package/dist/dist-esm/react-components/src/components/VideoGallery.js +15 -4
  25. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  26. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.d.ts +7 -3
  27. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js +22 -9
  28. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js.map +1 -1
  29. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +7 -4
  30. package/dist/dist-esm/react-components/src/theming/icons.d.ts +2 -0
  31. package/dist/dist-esm/react-components/src/theming/icons.js +6 -2
  32. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  33. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +12 -0
  34. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  35. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +1 -0
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +18 -4
  37. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  38. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +18 -3
  39. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  40. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +1 -0
  41. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  42. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.js +1 -1
  43. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.js.map +1 -1
  44. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.js +1 -1
  45. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.js.map +1 -1
  46. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.js +1 -0
  47. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.js.map +1 -1
  48. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +9 -3
  49. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  50. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js +8 -3
  51. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js.map +1 -1
  52. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +3 -1
  53. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  54. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +1 -1
  55. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  56. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js +18 -1
  57. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js.map +1 -1
  58. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +5 -1
  59. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +4 -4
  60. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  61. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +1 -0
  62. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +6 -0
  63. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  64. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +4 -0
  65. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  66. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +1 -0
  67. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +4 -0
  68. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  69. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +8 -0
  70. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  71. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js +1 -1
  72. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js.map +1 -1
  73. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +2 -0
  74. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +3 -0
  75. package/package.json +8 -8
@@ -2,5 +2,5 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT license.
4
4
  // GENERATED FILE. DO NOT EDIT MANUALLY.
5
- module.exports = '1.4.3-alpha-202212090014.0';
5
+ module.exports = '1.4.3-alpha-202212130014.0';
6
6
  //# sourceMappingURL=telemetryVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,4BAA4B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.4.3-alpha-202212090014.0';\n"]}
1
+ {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,4BAA4B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.4.3-alpha-202212130014.0';\n"]}
@@ -22,10 +22,9 @@ export class ProxyVideoStreamRendererView {
22
22
  get(target, prop) {
23
23
  switch (prop) {
24
24
  case 'updateScalingMode': {
25
- return (args) => __awaiter(this, void 0, void 0, function* () {
26
- const result = yield target.updateScalingMode(...args);
25
+ return (...args) => __awaiter(this, void 0, void 0, function* () {
26
+ yield target.updateScalingMode(...args);
27
27
  this._context.setRemoteVideoStreamViewScalingMode(this._callId, this._participantId, this._streamId, args[0]);
28
- return result;
29
28
  });
30
29
  }
31
30
  default:
@@ -1 +1 @@
1
- {"version":3,"file":"VideoStreamRendererViewDeclarative.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/VideoStreamRendererViewDeclarative.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAKlC;;GAEG;AACH,MAAM,OAAO,4BAA4B;IAMvC,YAAY,OAAoB,EAAE,MAAc,EAAE,aAAqB,EAAE,SAAiB;QACxF,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAEM,GAAG,CAA0C,MAA+B,EAAE,IAAO;QAC1F,QAAQ,IAAI,EAAE;YACZ,KAAK,mBAAmB,CAAC,CAAC;gBACxB,OAAO,CAAO,IAA8D,EAAE,EAAE;oBAC9E,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC,CAAC;oBACvD,IAAI,CAAC,QAAQ,CAAC,mCAAmC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC9G,OAAO,MAAM,CAAC;gBAChB,CAAC,CAAA,CAAC;aACH;YACD;gBACE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;SACpC;IACH,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAChD,IAA6B,EAC7B,OAAoB,EACpB,MAAc,EACd,aAAqB,EACrB,QAAgB,EACS,EAAE;IAC3B,MAAM,4BAA4B,GAAG,IAAI,4BAA4B,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;IAChH,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE,4BAA4B,CAA4B,CAAC;AAClF,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { VideoStreamRendererView } from '@azure/communication-calling';\nimport { CallContext } from './CallContext';\n\n/**\n * @private\n */\nexport class ProxyVideoStreamRendererView implements ProxyHandler<VideoStreamRendererView> {\n private _context: CallContext;\n private _callId: string;\n private _participantId: string;\n private _streamId: number;\n\n constructor(context: CallContext, callId: string, participantId: string, _streamId: number) {\n this._context = context;\n this._callId = callId;\n this._participantId = participantId;\n this._streamId = _streamId;\n }\n\n public get<P extends keyof VideoStreamRendererView>(target: VideoStreamRendererView, prop: P): any {\n switch (prop) {\n case 'updateScalingMode': {\n return async (args: Parameters<VideoStreamRendererView['updateScalingMode']>) => {\n const result = await target.updateScalingMode(...args);\n this._context.setRemoteVideoStreamViewScalingMode(this._callId, this._participantId, this._streamId, args[0]);\n return result;\n };\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/**\n * Creates a declarative VideoStreamRendererView that is backed by a VideoStreamRendererView from the SDK.\n * Calling methods on this declarative object triggers state updates in the stateful client.\n */\nexport const videoStreamRendererViewDeclaratify = (\n view: VideoStreamRendererView,\n context: CallContext,\n callId: string,\n participantId: string,\n streamId: number\n): VideoStreamRendererView => {\n const proxyVideoStreamRendererView = new ProxyVideoStreamRendererView(context, callId, participantId, streamId);\n return new Proxy(view, proxyVideoStreamRendererView) as VideoStreamRendererView;\n};\n"]}
1
+ {"version":3,"file":"VideoStreamRendererViewDeclarative.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/VideoStreamRendererViewDeclarative.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAKlC;;GAEG;AACH,MAAM,OAAO,4BAA4B;IAMvC,YAAY,OAAoB,EAAE,MAAc,EAAE,aAAqB,EAAE,SAAiB;QACxF,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAEM,GAAG,CAA0C,MAA+B,EAAE,IAAO;QAC1F,QAAQ,IAAI,EAAE;YACZ,KAAK,mBAAmB,CAAC,CAAC;gBACxB,OAAO,CAAO,GAAG,IAA8D,EAAE,EAAE;oBACjF,MAAM,MAAM,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC,CAAC;oBACxC,IAAI,CAAC,QAAQ,CAAC,mCAAmC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;gBAChH,CAAC,CAAA,CAAC;aACH;YACD;gBACE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;SACpC;IACH,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAChD,IAA6B,EAC7B,OAAoB,EACpB,MAAc,EACd,aAAqB,EACrB,QAAgB,EACS,EAAE;IAC3B,MAAM,4BAA4B,GAAG,IAAI,4BAA4B,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;IAChH,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE,4BAA4B,CAA4B,CAAC;AAClF,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { VideoStreamRendererView } from '@azure/communication-calling';\nimport { CallContext } from './CallContext';\n\n/**\n * @private\n */\nexport class ProxyVideoStreamRendererView implements ProxyHandler<VideoStreamRendererView> {\n private _context: CallContext;\n private _callId: string;\n private _participantId: string;\n private _streamId: number;\n\n constructor(context: CallContext, callId: string, participantId: string, _streamId: number) {\n this._context = context;\n this._callId = callId;\n this._participantId = participantId;\n this._streamId = _streamId;\n }\n\n public get<P extends keyof VideoStreamRendererView>(target: VideoStreamRendererView, prop: P): any {\n switch (prop) {\n case 'updateScalingMode': {\n return async (...args: Parameters<VideoStreamRendererView['updateScalingMode']>) => {\n await target.updateScalingMode(...args);\n this._context.setRemoteVideoStreamViewScalingMode(this._callId, this._participantId, this._streamId, args[0]);\n };\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/**\n * Creates a declarative VideoStreamRendererView that is backed by a VideoStreamRendererView from the SDK.\n * Calling methods on this declarative object triggers state updates in the stateful client.\n */\nexport const videoStreamRendererViewDeclaratify = (\n view: VideoStreamRendererView,\n context: CallContext,\n callId: string,\n participantId: string,\n streamId: number\n): VideoStreamRendererView => {\n const proxyVideoStreamRendererView = new ProxyVideoStreamRendererView(context, callId, participantId, streamId);\n return new Proxy(view, proxyVideoStreamRendererView) as VideoStreamRendererView;\n};\n"]}
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { CreateVideoStreamViewResult, OnRenderAvatarCallback, ParticipantState, VideoStreamOptions } from '../types';
2
+ import { CreateVideoStreamViewResult, OnRenderAvatarCallback, ParticipantState, VideoGalleryRemoteParticipant, VideoStreamOptions } from '../types';
3
+ import { VideoGalleryStrings } from './VideoGallery';
3
4
  /**
4
5
  * A memoized version of VideoTile for rendering remote participants. React.memo is used for a performance
5
6
  * boost by memoizing the same rendered component to avoid rerendering a VideoTile when its position in the
@@ -9,20 +10,20 @@ import { CreateVideoStreamViewResult, OnRenderAvatarCallback, ParticipantState,
9
10
  */
10
11
  export declare const _RemoteVideoTile: React.MemoExoticComponent<(props: {
11
12
  userId: string;
13
+ remoteParticipant: VideoGalleryRemoteParticipant;
12
14
  onCreateRemoteStreamView?: ((userId: string, options?: VideoStreamOptions | undefined) => Promise<void | CreateVideoStreamViewResult>) | undefined;
13
15
  onDisposeRemoteStreamView?: ((userId: string) => Promise<void>) | undefined;
14
16
  isAvailable?: boolean | undefined;
15
17
  isReceiving?: boolean | undefined;
16
- isMuted?: boolean | undefined;
17
- isSpeaking?: boolean | undefined;
18
18
  isScreenSharingOn?: boolean | undefined;
19
19
  renderElement?: HTMLElement | undefined;
20
- displayName?: string | undefined;
21
20
  remoteVideoViewOptions?: VideoStreamOptions | undefined;
22
21
  onRenderAvatar?: OnRenderAvatarCallback | undefined;
23
22
  showMuteIndicator?: boolean | undefined;
24
23
  showLabel?: boolean | undefined;
25
24
  personaMinSize?: number | undefined;
25
+ strings?: VideoGalleryStrings | undefined;
26
26
  participantState?: ParticipantState | undefined;
27
+ showRemoteVideoTileContextualMenu?: boolean | undefined;
27
28
  }) => JSX.Element>;
28
29
  //# sourceMappingURL=RemoteVideoTile.d.ts.map
@@ -3,6 +3,7 @@
3
3
  import React, { useMemo } from 'react';
4
4
  import { StreamMedia } from './StreamMedia';
5
5
  import { useRemoteVideoStreamLifecycleMaintainer } from './VideoGallery/useVideoStreamLifecycleMaintainer';
6
+ import { useVideoTileContextualMenuProps } from './VideoGallery/useVideoTileContextualMenuProps';
6
7
  import { VideoTile } from './VideoTile';
7
8
  /**
8
9
  * A memoized version of VideoTile for rendering remote participants. React.memo is used for a performance
@@ -13,7 +14,7 @@ import { VideoTile } from './VideoTile';
13
14
  */
14
15
  export const _RemoteVideoTile = React.memo((props) => {
15
16
  const { isAvailable, isReceiving = true, // default to true to prevent any breaking change
16
- isMuted, isSpeaking, isScreenSharingOn, onCreateRemoteStreamView, onDisposeRemoteStreamView, remoteVideoViewOptions, renderElement, userId, displayName, onRenderAvatar, showMuteIndicator } = props;
17
+ isScreenSharingOn, onCreateRemoteStreamView, onDisposeRemoteStreamView, remoteVideoViewOptions, renderElement, userId, onRenderAvatar, showMuteIndicator, remoteParticipant, participantState, showRemoteVideoTileContextualMenu = true } = props;
17
18
  const remoteVideoStreamProps = useMemo(() => ({
18
19
  isMirrored: remoteVideoViewOptions === null || remoteVideoViewOptions === void 0 ? void 0 : remoteVideoViewOptions.isMirrored,
19
20
  isScreenSharingOn,
@@ -36,8 +37,20 @@ export const _RemoteVideoTile = React.memo((props) => {
36
37
  userId
37
38
  ]);
38
39
  // Handle creating, destroying and updating the video stream as necessary
39
- useRemoteVideoStreamLifecycleMaintainer(remoteVideoStreamProps);
40
- const showLoadingIndicator = isAvailable && isReceiving === false && props.participantState !== 'Disconnected';
40
+ const createVideoStreamResult = useRemoteVideoStreamLifecycleMaintainer(remoteVideoStreamProps);
41
+ const contextualMenuProps = useVideoTileContextualMenuProps({
42
+ remoteParticipant,
43
+ view: createVideoStreamResult === null || createVideoStreamResult === void 0 ? void 0 : createVideoStreamResult.view,
44
+ /* @conditional-compile-remove(pinned-participants) */
45
+ strings: Object.assign({}, props.strings)
46
+ });
47
+ const videoTileContextualMenuProps = useMemo(() => {
48
+ if (!showRemoteVideoTileContextualMenu) {
49
+ return {};
50
+ }
51
+ return videoTileContextualMenuPropsTrampoline(contextualMenuProps);
52
+ }, [contextualMenuProps, showRemoteVideoTileContextualMenu]);
53
+ const showLoadingIndicator = isAvailable && isReceiving === false && participantState !== 'Disconnected';
41
54
  const renderVideoStreamElement = useMemo(() => {
42
55
  // Checking if renderElement is well defined or not as calling SDK has a number of video streams limitation which
43
56
  // implies that, after their threshold, all streams have no child (blank video)
@@ -47,9 +60,19 @@ export const _RemoteVideoTile = React.memo((props) => {
47
60
  }
48
61
  return (React.createElement(StreamMedia, { videoStreamElement: renderElement, loadingState: showLoadingIndicator ? 'loading' : 'none' }));
49
62
  }, [renderElement, showLoadingIndicator]);
50
- return (React.createElement(VideoTile, { key: userId, userId: userId, renderElement: renderVideoStreamElement, displayName: displayName, onRenderPlaceholder: onRenderAvatar, isMuted: isMuted, isSpeaking: isSpeaking, showMuteIndicator: showMuteIndicator, personaMinSize: props.personaMinSize, showLabel: props.showLabel,
63
+ return (React.createElement(VideoTile, Object.assign({ key: userId, userId: userId, renderElement: renderVideoStreamElement, displayName: remoteParticipant.displayName, onRenderPlaceholder: onRenderAvatar, isMuted: remoteParticipant.isMuted, isSpeaking: remoteParticipant.isSpeaking, showMuteIndicator: showMuteIndicator, personaMinSize: props.personaMinSize, showLabel: props.showLabel,
51
64
  /* @conditional-compile-remove(one-to-n-calling) */
52
65
  /* @conditional-compile-remove(PSTN-calls) */
53
- participantState: props.participantState }));
66
+ participantState: participantState }, videoTileContextualMenuProps)));
54
67
  });
68
+ const videoTileContextualMenuPropsTrampoline = (contextualMenuProps) => {
69
+ if (!contextualMenuProps) {
70
+ return {};
71
+ }
72
+ /* @conditional-compile-remove(pinned-participants) */
73
+ return {
74
+ contextualMenu: contextualMenuProps
75
+ };
76
+ return {};
77
+ };
55
78
  //# sourceMappingURL=RemoteVideoTile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteVideoTile.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/RemoteVideoTile.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,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AK,CAAC,gBAAgB,KAAK,cAAc,CAAC;IAE/G,MAAM,wBAAwB,GAAG,OAAO,CAAC,GAAG,EAAE;QAC5C,iHAAiH;QACjH,+EAA+E;QAC/E,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE;YACtD,2EAA2E;YAC3E,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,CACL,oBAAC,WAAW,IAAC,kBAAkB,EAAE,aAAa,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,GAAI,CAC5G,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,wBAAwB,EACvC,WAAW,EAAE,WAAW,EACxB,mBAAmB,EAAE,cAAc,EACnC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,KAAK,CAAC,cAAc,EACpC,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,mDAAmD;QACnD,6CAA6C;QAC7C,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,GACxC,CACH,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useMemo } from 'react';\nimport { CreateVideoStreamViewResult, OnRenderAvatarCallback, ParticipantState, VideoStreamOptions } from '../types';\nimport { StreamMedia } from './StreamMedia';\nimport {\n useRemoteVideoStreamLifecycleMaintainer,\n RemoteVideoStreamLifecycleMaintainerProps\n} from './VideoGallery/useVideoStreamLifecycleMaintainer';\nimport { VideoTile } from './VideoTile';\n\n/**\n * A memoized version of VideoTile for rendering remote participants. React.memo is used for a performance\n * boost by memoizing the same rendered component to avoid rerendering a VideoTile when its position in the\n * array changes causing a rerender in the parent component. https://reactjs.org/docs/react-api.html#reactmemo\n *\n * @internal\n */\nexport const _RemoteVideoTile = React.memo(\n (props: {\n userId: string;\n onCreateRemoteStreamView?: (\n userId: string,\n options?: VideoStreamOptions\n ) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeRemoteStreamView?: (userId: string) => Promise<void>;\n isAvailable?: boolean;\n isReceiving?: boolean;\n isMuted?: boolean;\n isSpeaking?: boolean;\n isScreenSharingOn?: boolean; // TODO: Remove this once onDisposeRemoteStreamView no longer disposes of screen share stream\n renderElement?: HTMLElement;\n displayName?: string;\n remoteVideoViewOptions?: VideoStreamOptions;\n onRenderAvatar?: OnRenderAvatarCallback;\n showMuteIndicator?: boolean;\n showLabel?: boolean;\n personaMinSize?: number;\n participantState?: ParticipantState;\n }) => {\n const {\n isAvailable,\n isReceiving = true, // default to true to prevent any breaking change\n isMuted,\n isSpeaking,\n isScreenSharingOn,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteVideoViewOptions,\n renderElement,\n userId,\n displayName,\n onRenderAvatar,\n showMuteIndicator\n } = props;\n\n const remoteVideoStreamProps: RemoteVideoStreamLifecycleMaintainerProps = useMemo(\n () => ({\n isMirrored: remoteVideoViewOptions?.isMirrored,\n isScreenSharingOn,\n isStreamAvailable: isAvailable,\n isStreamReceiving: isReceiving,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteParticipantId: userId,\n renderElementExists: !!renderElement,\n scalingMode: remoteVideoViewOptions?.scalingMode\n }),\n [\n isAvailable,\n isReceiving,\n isScreenSharingOn,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteVideoViewOptions?.isMirrored,\n remoteVideoViewOptions?.scalingMode,\n renderElement,\n userId\n ]\n );\n\n // Handle creating, destroying and updating the video stream as necessary\n useRemoteVideoStreamLifecycleMaintainer(remoteVideoStreamProps);\n\n const showLoadingIndicator = isAvailable && isReceiving === false && props.participantState !== 'Disconnected';\n\n const renderVideoStreamElement = useMemo(() => {\n // Checking if renderElement is well defined or not as calling SDK has a number of video streams limitation which\n // implies that, after their threshold, all streams have no child (blank video)\n if (!renderElement || !renderElement.childElementCount) {\n // Returning `undefined` results in the placeholder with avatar being shown\n return undefined;\n }\n\n return (\n <StreamMedia videoStreamElement={renderElement} loadingState={showLoadingIndicator ? 'loading' : 'none'} />\n );\n }, [renderElement, showLoadingIndicator]);\n\n return (\n <VideoTile\n key={userId}\n userId={userId}\n renderElement={renderVideoStreamElement}\n displayName={displayName}\n onRenderPlaceholder={onRenderAvatar}\n isMuted={isMuted}\n isSpeaking={isSpeaking}\n showMuteIndicator={showMuteIndicator}\n personaMinSize={props.personaMinSize}\n showLabel={props.showLabel}\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n participantState={props.participantState}\n />\n );\n }\n);\n"]}
1
+ {"version":3,"file":"RemoteVideoTile.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/RemoteVideoTile.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAQvC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAEL,uCAAuC,EACxC,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,+BAA+B,EAAE,MAAM,gDAAgD,CAAC;AACjG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CACxC,CAAC,KAoBA,EAAE,EAAE;IACH,MAAM,EACJ,WAAW,EACX,WAAW,GAAG,IAAI,EAAE,iDAAiD;IACrE,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EACb,MAAM,EACN,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,iC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,cAAc,CAAC;IAEzG,MAAM,wBAAwB,GAAG,OAAO,CAAC,GAAG,EAAE;QAC5C,iHAAiH;QACjH,+EAA+E;QAC/E,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE;YACtD,2EAA2E;YAC3E,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,CACL,oBAAC,WAAW,IAAC,kBAAkB,EAAE,aAAa,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,GAAI,CAC5G,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,oBAAC,SAAS,kBACR,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,wBAAwB,EACvC,WAAW,EAAE,iBAAiB,CAAC,WAAW,EAC1C,mBAAmB,EAAE,cAAc,EACnC,OAAO,EAAE,iBAAiB,CAAC,OAAO,EAClC,UAAU,EAAE,iBAAiB,CAAC,UAAU,EACxC,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,KAAK,CAAC,cAAc,EACpC,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,mDAAmD;QACnD,6CAA6C;QAC7C,gBAAgB,EAAE,gBAAgB,IAC9B,4BAA4B,EAChC,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,sCAAsC,GAAG,CAC7C,mBAA0C,EACC,EAAE;IAC7C,IAAI,CAAC,mBAAmB,EAAE;QACxB,OAAO,EAAE,CAAC;KACX;IACD,sDAAsD;IACtD,OAAO;QACL,cAAc,EAAE,mBAAmB;KACpC,CAAC;IAEF,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { IContextualMenuProps } from '@fluentui/react';\nimport React, { useMemo } from 'react';\nimport {\n CreateVideoStreamViewResult,\n OnRenderAvatarCallback,\n ParticipantState,\n VideoGalleryRemoteParticipant,\n VideoStreamOptions\n} from '../types';\nimport { StreamMedia } from './StreamMedia';\nimport { VideoGalleryStrings } from './VideoGallery';\nimport {\n RemoteVideoStreamLifecycleMaintainerProps,\n useRemoteVideoStreamLifecycleMaintainer\n} from './VideoGallery/useVideoStreamLifecycleMaintainer';\nimport { useVideoTileContextualMenuProps } from './VideoGallery/useVideoTileContextualMenuProps';\nimport { VideoTile } from './VideoTile';\n\n/**\n * A memoized version of VideoTile for rendering remote participants. React.memo is used for a performance\n * boost by memoizing the same rendered component to avoid rerendering a VideoTile when its position in the\n * array changes causing a rerender in the parent component. https://reactjs.org/docs/react-api.html#reactmemo\n *\n * @internal\n */\nexport const _RemoteVideoTile = React.memo(\n (props: {\n userId: string;\n remoteParticipant: VideoGalleryRemoteParticipant;\n onCreateRemoteStreamView?: (\n userId: string,\n options?: VideoStreamOptions\n ) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeRemoteStreamView?: (userId: string) => Promise<void>;\n isAvailable?: boolean;\n isReceiving?: boolean;\n isScreenSharingOn?: boolean; // TODO: Remove this once onDisposeRemoteStreamView no longer disposes of screen share stream\n renderElement?: HTMLElement;\n remoteVideoViewOptions?: VideoStreamOptions;\n onRenderAvatar?: OnRenderAvatarCallback;\n showMuteIndicator?: boolean;\n showLabel?: boolean;\n personaMinSize?: number;\n strings?: VideoGalleryStrings;\n participantState?: ParticipantState;\n showRemoteVideoTileContextualMenu?: boolean;\n }) => {\n const {\n isAvailable,\n isReceiving = true, // default to true to prevent any breaking change\n isScreenSharingOn,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteVideoViewOptions,\n renderElement,\n userId,\n onRenderAvatar,\n showMuteIndicator,\n remoteParticipant,\n participantState,\n showRemoteVideoTileContextualMenu = true\n } = props;\n\n const remoteVideoStreamProps: RemoteVideoStreamLifecycleMaintainerProps = useMemo(\n () => ({\n isMirrored: remoteVideoViewOptions?.isMirrored,\n isScreenSharingOn,\n isStreamAvailable: isAvailable,\n isStreamReceiving: isReceiving,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteParticipantId: userId,\n renderElementExists: !!renderElement,\n scalingMode: remoteVideoViewOptions?.scalingMode\n }),\n [\n isAvailable,\n isReceiving,\n isScreenSharingOn,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteVideoViewOptions?.isMirrored,\n remoteVideoViewOptions?.scalingMode,\n renderElement,\n userId\n ]\n );\n\n // Handle creating, destroying and updating the video stream as necessary\n const createVideoStreamResult = useRemoteVideoStreamLifecycleMaintainer(remoteVideoStreamProps);\n\n const contextualMenuProps = useVideoTileContextualMenuProps({\n remoteParticipant,\n view: createVideoStreamResult?.view,\n /* @conditional-compile-remove(pinned-participants) */\n strings: { ...props.strings }\n });\n\n const videoTileContextualMenuProps = useMemo(() => {\n if (!showRemoteVideoTileContextualMenu) {\n return {};\n }\n return videoTileContextualMenuPropsTrampoline(contextualMenuProps);\n }, [contextualMenuProps, showRemoteVideoTileContextualMenu]);\n\n const showLoadingIndicator = isAvailable && isReceiving === false && participantState !== 'Disconnected';\n\n const renderVideoStreamElement = useMemo(() => {\n // Checking if renderElement is well defined or not as calling SDK has a number of video streams limitation which\n // implies that, after their threshold, all streams have no child (blank video)\n if (!renderElement || !renderElement.childElementCount) {\n // Returning `undefined` results in the placeholder with avatar being shown\n return undefined;\n }\n\n return (\n <StreamMedia videoStreamElement={renderElement} loadingState={showLoadingIndicator ? 'loading' : 'none'} />\n );\n }, [renderElement, showLoadingIndicator]);\n\n return (\n <VideoTile\n key={userId}\n userId={userId}\n renderElement={renderVideoStreamElement}\n displayName={remoteParticipant.displayName}\n onRenderPlaceholder={onRenderAvatar}\n isMuted={remoteParticipant.isMuted}\n isSpeaking={remoteParticipant.isSpeaking}\n showMuteIndicator={showMuteIndicator}\n personaMinSize={props.personaMinSize}\n showLabel={props.showLabel}\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n participantState={participantState}\n {...videoTileContextualMenuProps}\n />\n );\n }\n);\n\nconst videoTileContextualMenuPropsTrampoline = (\n contextualMenuProps?: IContextualMenuProps\n): { contextualMenu?: IContextualMenuProps } => {\n if (!contextualMenuProps) {\n return {};\n }\n /* @conditional-compile-remove(pinned-participants) */\n return {\n contextualMenu: contextualMenuProps\n };\n\n return {};\n};\n"]}
@@ -11,6 +11,8 @@ export interface UnsupportedBrowserVersionStrings {
11
11
  secondaryText: string;
12
12
  /** String to display in the text for the help link */
13
13
  moreHelpLinkText: string;
14
+ /** String for continue without updating button */
15
+ continueAnywayButtonText?: string;
14
16
  }
15
17
  /**
16
18
  * props for {@link UnsupportedBrowserVersion} UI
@@ -21,7 +23,9 @@ export interface UnsupportedBrowserVersionProps {
21
23
  /** Handler to perform an action when the help link is actioned */
22
24
  onTroubleshootingClick?: () => void;
23
25
  /** String overrides for the component */
24
- strings: UnsupportedBrowserVersionStrings;
26
+ strings?: UnsupportedBrowserVersionStrings;
27
+ /** Handler to allow user to continue into the call */
28
+ onContinueClick?: () => void;
25
29
  }
26
30
  /**
27
31
  * UI to display to the user that the browser version they are using is out of date
@@ -9,7 +9,7 @@ import { UnsupportedEnvironment } from './UnsupportedEnvironment';
9
9
  * @beta
10
10
  */
11
11
  export const UnsupportedBrowserVersion = (props) => {
12
- const { onTroubleshootingClick, strings } = props;
13
- return React.createElement(UnsupportedEnvironment, { onTroubleshootingClick: onTroubleshootingClick, strings: strings });
12
+ const { onTroubleshootingClick, strings, onContinueClick } = props;
13
+ return (React.createElement(UnsupportedEnvironment, { onTroubleshootingClick: onTroubleshootingClick, strings: strings, onContinueClick: onContinueClick }));
14
14
  };
15
15
  //# sourceMappingURL=UnsupportedBrowserVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UnsupportedBrowserVersion.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/UnsupportedBrowserVersion.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AA4BlE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,KAAqC,EAAe,EAAE;IAC9F,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAClD,OAAO,oBAAC,sBAAsB,IAAC,sBAAsB,EAAE,sBAAsB,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC;AACtG,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { _pxToRem } from '@internal/acs-ui-common';\nimport React from 'react';\nimport { UnsupportedEnvironment } from './UnsupportedEnvironment';\n\n/**\n * Strings for UnsupportedBrowser component\n *\n * @beta\n */\nexport interface UnsupportedBrowserVersionStrings {\n /** String for the primary text */\n primaryText: string;\n /** String for the secondary text */\n secondaryText: string;\n /** String to display in the text for the help link */\n moreHelpLinkText: string;\n}\n\n/**\n * props for {@link UnsupportedBrowserVersion} UI\n *\n * @beta\n */\nexport interface UnsupportedBrowserVersionProps {\n /** Handler to perform an action when the help link is actioned */\n onTroubleshootingClick?: () => void;\n /** String overrides for the component */\n strings: UnsupportedBrowserVersionStrings;\n}\n\n/**\n * UI to display to the user that the browser version they are using is out of date\n * and not supported by Azure Communications Calling service.\n *\n * @beta\n */\nexport const UnsupportedBrowserVersion = (props: UnsupportedBrowserVersionProps): JSX.Element => {\n const { onTroubleshootingClick, strings } = props;\n return <UnsupportedEnvironment onTroubleshootingClick={onTroubleshootingClick} strings={strings} />;\n};\n\"../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"UnsupportedBrowserVersion.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/UnsupportedBrowserVersion.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAgClE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,KAAqC,EAAe,EAAE;IAC9F,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IACnE,OAAO,CACL,oBAAC,sBAAsB,IACrB,sBAAsB,EAAE,sBAAsB,EAC9C,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,eAAe,GAChC,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { _pxToRem } from '@internal/acs-ui-common';\nimport React from 'react';\nimport { UnsupportedEnvironment } from './UnsupportedEnvironment';\n\n/**\n * Strings for UnsupportedBrowser component\n *\n * @beta\n */\nexport interface UnsupportedBrowserVersionStrings {\n /** String for the primary text */\n primaryText: string;\n /** String for the secondary text */\n secondaryText: string;\n /** String to display in the text for the help link */\n moreHelpLinkText: string;\n /** String for continue without updating button */\n continueAnywayButtonText?: string;\n}\n\n/**\n * props for {@link UnsupportedBrowserVersion} UI\n *\n * @beta\n */\nexport interface UnsupportedBrowserVersionProps {\n /** Handler to perform an action when the help link is actioned */\n onTroubleshootingClick?: () => void;\n /** String overrides for the component */\n strings?: UnsupportedBrowserVersionStrings;\n /** Handler to allow user to continue into the call */\n onContinueClick?: () => void;\n}\n\n/**\n * UI to display to the user that the browser version they are using is out of date\n * and not supported by Azure Communications Calling service.\n *\n * @beta\n */\nexport const UnsupportedBrowserVersion = (props: UnsupportedBrowserVersionProps): JSX.Element => {\n const { onTroubleshootingClick, strings, onContinueClick } = props;\n return (\n <UnsupportedEnvironment\n onTroubleshootingClick={onTroubleshootingClick}\n strings={strings}\n onContinueClick={onContinueClick}\n />\n );\n};\n\"../../../acs-ui-common/src\""]}
@@ -9,6 +9,8 @@ export interface UnsupportedEnvironmentStrings {
9
9
  secondaryText: string;
10
10
  /** String to display in the text for the help link */
11
11
  moreHelpLinkText: string;
12
+ /** String for continue anyway button */
13
+ continueAnywayButtonText?: string;
12
14
  }
13
15
  /**
14
16
  * props for {@link UnsupportedEnvironment} UI
@@ -16,10 +18,19 @@ export interface UnsupportedEnvironmentStrings {
16
18
  * @private
17
19
  */
18
20
  export interface UnsupportedEnvironmentProps {
19
- /** Handler to perform a action when the help link is actioned */
21
+ /**
22
+ * Handler to perform a action when the help link is actioned
23
+ */
20
24
  onTroubleshootingClick?: () => void;
21
- /** String overrides for the component */
22
- strings: UnsupportedEnvironmentStrings;
25
+ /**
26
+ * String overrides for the component
27
+ */
28
+ strings?: UnsupportedEnvironmentStrings;
29
+ /**
30
+ * CallBack for the continue anyay button. Use this as a mechanism to allow users into
31
+ * a call with a unsupported browser version.
32
+ */
33
+ onContinueClick?: () => void;
23
34
  }
24
35
  /**
25
36
  * UI to display to the user that the environment they are using is not supported by calling application.
@@ -1,20 +1,23 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
3
  /* @conditional-compile-remove(unsupported-browser) */
4
- import { Icon, Link, Stack, Text } from '@fluentui/react';
4
+ import { DefaultButton, Icon, Link, Stack, Text } from '@fluentui/react';
5
5
  import React from 'react';
6
6
  /* @conditional-compile-remove(unsupported-browser) */
7
- import { containerStyles, iconStyles, linkTextStyles, mainTextStyles, secondaryTextStyles } from './styles/UnsupportedEnvironment.styles';
7
+ import { useTheme } from '../theming';
8
+ /* @conditional-compile-remove(unsupported-browser) */
9
+ import { containerStyles, continueAnywayButtonStyles, linkTextStyles, mainTextStyles, secondaryTextStyles, testContainerStyles } from './styles/UnsupportedEnvironment.styles';
8
10
  /* @conditional-compile-remove(unsupported-browser) */
9
11
  const UnsupportedEnvironmentContainer = (props) => {
10
- const { onTroubleshootingClick, strings } = props;
11
- return (React.createElement(Stack, { styles: containerStyles },
12
- React.createElement(Icon, { styles: iconStyles, iconName: "UnsupportedEnvironmentWarning", "data-ui-id": "unsupported-environment-icon" }),
13
- React.createElement(Text, { styles: mainTextStyles }, strings.primaryText),
14
- React.createElement(Text, { styles: secondaryTextStyles }, strings.secondaryText),
15
- onTroubleshootingClick && (React.createElement(Link, { styles: linkTextStyles, onClick: () => {
16
- onTroubleshootingClick();
17
- }, "data-ui-id": "unsupported-environment-link" }, strings.moreHelpLinkText))));
12
+ const { onTroubleshootingClick, strings, onContinueClick } = props;
13
+ const theme = useTheme();
14
+ return (React.createElement(Stack, { styles: containerStyles, tokens: { childrenGap: '2rem' } },
15
+ React.createElement(Icon, { iconName: "UnsupportedEnvironmentWarning", "data-ui-id": "unsupported-environment-icon" }),
16
+ React.createElement(Stack, { styles: testContainerStyles, tokens: { childrenGap: '0.25rem' } },
17
+ React.createElement(Text, { styles: mainTextStyles }, strings === null || strings === void 0 ? void 0 : strings.primaryText),
18
+ React.createElement(Text, { styles: secondaryTextStyles }, strings === null || strings === void 0 ? void 0 : strings.secondaryText)),
19
+ onTroubleshootingClick && (React.createElement(Link, { styles: linkTextStyles, onClick: onTroubleshootingClick, "data-ui-id": "unsupported-environment-link" }, strings === null || strings === void 0 ? void 0 : strings.moreHelpLinkText)),
20
+ onContinueClick && (React.createElement(DefaultButton, { styles: continueAnywayButtonStyles(theme), onClick: onContinueClick }, strings === null || strings === void 0 ? void 0 : strings.continueAnywayButtonText))));
18
21
  };
19
22
  /**
20
23
  * UI to display to the user that the environment they are using is not supported by calling application.
@@ -1 +1 @@
1
- {"version":3,"file":"UnsupportedEnvironment.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/UnsupportedEnvironment.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,sDAAsD;AACtD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,sDAAsD;AACtD,OAAO,EACL,eAAe,EACf,UAAU,EACV,cAAc,EACd,cAAc,EACd,mBAAmB,EACpB,MAAM,wCAAwC,CAAC;AA0BhD,sDAAsD;AACtD,MAAM,+BAA+B,GAAG,CAAC,KAAkC,EAAe,EAAE;IAC1F,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAClD,OAAO,CACL,oBAAC,KAAK,IAAC,MAAM,EAAE,eAAe;QAC5B,oBAAC,IAAI,IACH,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAC,+BAA+B,gBAC7B,8BAA8B,GACnC;QACR,oBAAC,IAAI,IAAC,MAAM,EAAE,cAAc,IAAG,OAAO,CAAC,WAAW,CAAQ;QAC1D,oBAAC,IAAI,IAAC,MAAM,EAAE,mBAAmB,IAAG,OAAO,CAAC,aAAa,CAAQ;QAChE,sBAAsB,IAAI,CACzB,oBAAC,IAAI,IACH,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,GAAG,EAAE;gBACZ,sBAAsB,EAAE,CAAC;YAC3B,CAAC,gBACU,8BAA8B,IAExC,OAAO,CAAC,gBAAgB,CACpB,CACR,CACK,CACT,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAkC,EAAe,EAAE;IACxF,sDAAsD;IACtD,OAAO,oBAAC,+BAA+B,oBAAK,KAAK,EAAI,CAAC;IACtD,OAAO,yCAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/* @conditional-compile-remove(unsupported-browser) */\nimport { Icon, Link, Stack, Text } from '@fluentui/react';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { _pxToRem } from '@internal/acs-ui-common';\nimport React from 'react';\n/* @conditional-compile-remove(unsupported-browser) */\nimport {\n containerStyles,\n iconStyles,\n linkTextStyles,\n mainTextStyles,\n secondaryTextStyles\n} from './styles/UnsupportedEnvironment.styles';\n\n/**\n * @private\n */\nexport interface UnsupportedEnvironmentStrings {\n /** String for the primary text */\n primaryText: string;\n /** String for the secondary text */\n secondaryText: string;\n /** String to display in the text for the help link */\n moreHelpLinkText: string;\n}\n\n/**\n * props for {@link UnsupportedEnvironment} UI\n *\n * @private\n */\nexport interface UnsupportedEnvironmentProps {\n /** Handler to perform a action when the help link is actioned */\n onTroubleshootingClick?: () => void;\n /** String overrides for the component */\n strings: UnsupportedEnvironmentStrings;\n}\n\n/* @conditional-compile-remove(unsupported-browser) */\nconst UnsupportedEnvironmentContainer = (props: UnsupportedEnvironmentProps): JSX.Element => {\n const { onTroubleshootingClick, strings } = props;\n return (\n <Stack styles={containerStyles}>\n <Icon\n styles={iconStyles}\n iconName=\"UnsupportedEnvironmentWarning\"\n data-ui-id=\"unsupported-environment-icon\"\n ></Icon>\n <Text styles={mainTextStyles}>{strings.primaryText}</Text>\n <Text styles={secondaryTextStyles}>{strings.secondaryText}</Text>\n {onTroubleshootingClick && (\n <Link\n styles={linkTextStyles}\n onClick={() => {\n onTroubleshootingClick();\n }}\n data-ui-id=\"unsupported-environment-link\"\n >\n {strings.moreHelpLinkText}\n </Link>\n )}\n </Stack>\n );\n};\n\n/**\n * UI to display to the user that the environment they are using is not supported by calling application.\n *\n * @private\n */\nexport const UnsupportedEnvironment = (props: UnsupportedEnvironmentProps): JSX.Element => {\n /* @conditional-compile-remove(unsupported-browser) */\n return <UnsupportedEnvironmentContainer {...props} />;\n return <></>;\n};\n\"../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"UnsupportedEnvironment.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/UnsupportedEnvironment.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,sDAAsD;AACtD,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGzE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,sDAAsD;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,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AE;IACxF,sDAAsD;IACtD,OAAO,oBAAC,+BAA+B,oBAAK,KAAK,EAAI,CAAC;IACtD,OAAO,yCAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/* @conditional-compile-remove(unsupported-browser) */\nimport { DefaultButton, Icon, Link, Stack, Text } from '@fluentui/react';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { _pxToRem } from '@internal/acs-ui-common';\nimport React from 'react';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { useTheme } from '../theming';\n/* @conditional-compile-remove(unsupported-browser) */\nimport {\n containerStyles,\n continueAnywayButtonStyles,\n linkTextStyles,\n mainTextStyles,\n secondaryTextStyles,\n testContainerStyles\n} from './styles/UnsupportedEnvironment.styles';\n\n/**\n * @private\n */\nexport interface UnsupportedEnvironmentStrings {\n /** String for the primary text */\n primaryText: string;\n /** String for the secondary text */\n secondaryText: string;\n /** String to display in the text for the help link */\n moreHelpLinkText: string;\n /** String for continue anyway button */\n continueAnywayButtonText?: string;\n}\n\n/**\n * props for {@link UnsupportedEnvironment} UI\n *\n * @private\n */\nexport interface UnsupportedEnvironmentProps {\n /**\n * Handler to perform a action when the help link is actioned\n */\n onTroubleshootingClick?: () => void;\n /**\n * String overrides for the component\n */\n strings?: UnsupportedEnvironmentStrings;\n /**\n * CallBack for the continue anyay button. Use this as a mechanism to allow users into\n * a call with a unsupported browser version.\n */\n onContinueClick?: () => void;\n}\n\n/* @conditional-compile-remove(unsupported-browser) */\nconst UnsupportedEnvironmentContainer = (props: UnsupportedEnvironmentProps): JSX.Element => {\n const { onTroubleshootingClick, strings, onContinueClick } = props;\n const theme = useTheme();\n return (\n <Stack styles={containerStyles} tokens={{ childrenGap: '2rem' }}>\n <Icon iconName=\"UnsupportedEnvironmentWarning\" data-ui-id=\"unsupported-environment-icon\"></Icon>\n <Stack styles={testContainerStyles} tokens={{ childrenGap: '0.25rem' }}>\n <Text styles={mainTextStyles}>{strings?.primaryText}</Text>\n <Text styles={secondaryTextStyles}>{strings?.secondaryText}</Text>\n </Stack>\n {onTroubleshootingClick && (\n <Link styles={linkTextStyles} onClick={onTroubleshootingClick} data-ui-id=\"unsupported-environment-link\">\n {strings?.moreHelpLinkText}\n </Link>\n )}\n {onContinueClick && (\n <DefaultButton styles={continueAnywayButtonStyles(theme)} onClick={onContinueClick}>\n {strings?.continueAnywayButtonText}\n </DefaultButton>\n )}\n </Stack>\n );\n};\n\n/**\n * UI to display to the user that the environment they are using is not supported by calling application.\n *\n * @private\n */\nexport const UnsupportedEnvironment = (props: UnsupportedEnvironmentProps): JSX.Element => {\n /* @conditional-compile-remove(unsupported-browser) */\n return <UnsupportedEnvironmentContainer {...props} />;\n return <></>;\n};\n\"../../../acs-ui-common/src\""]}
@@ -17,7 +17,7 @@ export interface LocalVideoStreamLifecycleMaintainerProps extends VideoStreamLif
17
17
  *
18
18
  * @private
19
19
  */
20
- export declare const useLocalVideoStreamLifecycleMaintainer: (props: LocalVideoStreamLifecycleMaintainerProps) => void;
20
+ export declare const useLocalVideoStreamLifecycleMaintainer: (props: LocalVideoStreamLifecycleMaintainerProps) => CreateVideoStreamViewResult | undefined;
21
21
  /** @private */
22
22
  export interface RemoteVideoStreamLifecycleMaintainerProps extends VideoStreamLifecycleMaintainerExtendableProps {
23
23
  onCreateRemoteStreamView?: (userId: string, options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;
@@ -29,5 +29,5 @@ export interface RemoteVideoStreamLifecycleMaintainerProps extends VideoStreamLi
29
29
  *
30
30
  * @private
31
31
  */
32
- export declare const useRemoteVideoStreamLifecycleMaintainer: (props: RemoteVideoStreamLifecycleMaintainerProps) => void;
32
+ export declare const useRemoteVideoStreamLifecycleMaintainer: (props: RemoteVideoStreamLifecycleMaintainerProps) => CreateVideoStreamViewResult | undefined;
33
33
  //# sourceMappingURL=useVideoStreamLifecycleMaintainer.d.ts.map
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
- import { useEffect, useMemo } from 'react';
3
+ import { useEffect, useMemo, useState } from 'react';
4
4
  /**
5
5
  * Helper hook to maintain the video stream lifecycle. This calls onCreateStreamView and onDisposeStreamView
6
6
  * appropriately based on react lifecycle events and prop changes.
@@ -21,9 +21,13 @@ import { useEffect, useMemo } from 'react';
21
21
  */
22
22
  const useVideoStreamLifecycleMaintainer = (props) => {
23
23
  const { isMirrored, isScreenSharingOn, isStreamAvailable, onCreateStreamView, onDisposeStreamView, renderElementExists, scalingMode } = props;
24
+ const [videoStreamViewResult, setVideoStreamViewResult] = useState();
24
25
  useEffect(() => {
26
+ var _a;
25
27
  if (isStreamAvailable && !renderElementExists) {
26
- onCreateStreamView === null || onCreateStreamView === void 0 ? void 0 : onCreateStreamView({ isMirrored, scalingMode });
28
+ (_a = onCreateStreamView === null || onCreateStreamView === void 0 ? void 0 : onCreateStreamView({ isMirrored, scalingMode })) === null || _a === void 0 ? void 0 : _a.then((result) => {
29
+ result && setVideoStreamViewResult(result);
30
+ });
27
31
  }
28
32
  // Always clean up element to make tile up to date and be able to dispose correctly
29
33
  return () => {
@@ -54,6 +58,7 @@ const useVideoStreamLifecycleMaintainer = (props) => {
54
58
  }
55
59
  };
56
60
  }, [isScreenSharingOn, onDisposeStreamView]);
61
+ return videoStreamViewResult;
57
62
  };
58
63
  /**
59
64
  * Extension of {@link useVideoStreamLifecycleMaintainer} specifically for local video streams
@@ -1 +1 @@
1
- {"version":3,"file":"useVideoStreamLifecycleMaintainer.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAiB3C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,iCAAiC,GAAG,CAAC,KAA0C,EAAQ,EAAE;IAC7F,MAAM,E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AC,CAAC;IAC5C,CAAC,EACD,CAAC,uBAAuB,CAAC,CAC1B,CAAC;IACF,MAAM,mBAAmB,GAAG,OAAO,CACjC,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,wBAAwB,aAAxB,wBAAwB,uBAAxB,wBAAwB,EAAI,CAAC;IAC/B,CAAC,EACD,CAAC,wBAAwB,CAAC,CAC3B,CAAC;IACF,OAAO,iCAAiC,iCACnC,KAAK,KACR,kBAAkB;QAClB,mBAAmB,IACnB,CAAC;AACL,CAAC,CAAC;AAYF;;;;GAIG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,KAAgD,EAAQ,EAAE;IAChH,MAAM,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,GAAG,KAAK,CAAC;IAC3F,MAAM,kBAAkB,GAAG,OAAO,CAChC,GAAG,EAAE,CAAC,CAAC,OAA4B,EAAE,EAAE;QACrC,OAAO,wBAAwB,aAAxB,wBAAwB,uBAAxB,wBAAwB,CAAG,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC,EACD,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,CAChD,CAAC;IACF,MAAM,mBAAmB,GAAG,OAAO,CACjC,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,yBAAyB,aAAzB,yBAAyB,uBAAzB,yBAAyB,CAAG,mBAAmB,CAAC,CAAC;IACnD,CAAC,EACD,CAAC,yBAAyB,EAAE,mBAAmB,CAAC,CACjD,CAAC;IAEF,OAAO,iCAAiC,iCACnC,KAAK,KACR,kBAAkB;QAClB,mBAAmB,IACnB,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { useEffect, useMemo } from 'react';\nimport { VideoStreamOptions, CreateVideoStreamViewResult, ViewScalingMode } from '../../types';\n\n/** @private */\nexport interface VideoStreamLifecycleMaintainerExtendableProps {\n isStreamAvailable?: boolean;\n renderElementExists?: boolean;\n isMirrored?: boolean;\n scalingMode?: ViewScalingMode;\n isScreenSharingOn?: boolean;\n}\n\ninterface VideoStreamLifecycleMaintainerProps extends VideoStreamLifecycleMaintainerExtendableProps {\n onCreateStreamView: (options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult> | undefined;\n onDisposeStreamView: () => void | undefined;\n}\n\n/**\n * Helper hook to maintain the video stream lifecycle. This calls onCreateStreamView and onDisposeStreamView\n * appropriately based on react lifecycle events and prop changes.\n *\n * @remarks\n *\n * Notes on handling changes to scaling mode:\n *\n * Ideally we have access to the original StreamRenderView and can call view.updateScalingMode() and do not need to recreate the stream view.\n * However, to support backwards compat we cannot guarantee this. If we don't have access to the original StreamRenderView we need to dispose\n * the old view and create a new one.\n *\n * Supporting both of these scenarios became too complex and fragile. When we introduce a breaking change this should be update to ensure that\n * onCreateStreamView _must_ return a view object with updateScalingMode and update logic in this hook to call view.updateScalingMode instead\n * of recreating the stream.\n *\n * @private\n */\nconst useVideoStreamLifecycleMaintainer = (props: VideoStreamLifecycleMaintainerProps): void => {\n const {\n isMirrored,\n isScreenSharingOn,\n isStreamAvailable,\n onCreateStreamView,\n onDisposeStreamView,\n renderElementExists,\n scalingMode\n } = props;\n\n useEffect(() => {\n if (isStreamAvailable && !renderElementExists) {\n onCreateStreamView?.({ isMirrored, scalingMode });\n }\n\n // Always clean up element to make tile up to date and be able to dispose correctly\n return () => {\n if (renderElementExists) {\n // TODO: Remove `if isScreenSharingOn` when we isolate dispose behavior for screen share\n if (!isScreenSharingOn) {\n onDisposeStreamView?.();\n }\n }\n };\n }, [\n isMirrored,\n isScreenSharingOn,\n isStreamAvailable,\n onCreateStreamView,\n onDisposeStreamView,\n renderElementExists,\n scalingMode\n ]);\n\n // The execution order for above useEffect is onCreateRemoteStreamView =>(async time gap) RenderElement generated => element disposed => onDisposeRemoteStreamView\n // Element disposed could happen during async time gap, which still cause leaks for unused renderElement.\n // Need to do an entire cleanup when remoteTile gets disposed and make sure element gets correctly disposed\n useEffect(() => {\n return () => {\n // TODO: Remove `if isScreenSharingOn` when we isolate dispose behavior for screen share\n if (!isScreenSharingOn) {\n onDisposeStreamView?.();\n }\n };\n }, [isScreenSharingOn, onDisposeStreamView]);\n};\n\n/** @private */\nexport interface LocalVideoStreamLifecycleMaintainerProps extends VideoStreamLifecycleMaintainerExtendableProps {\n onCreateLocalStreamView?: (options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeLocalStreamView?: () => void;\n}\n\n/**\n * Extension of {@link useVideoStreamLifecycleMaintainer} specifically for local video streams\n *\n * @private\n */\nexport const useLocalVideoStreamLifecycleMaintainer = (props: LocalVideoStreamLifecycleMaintainerProps): void => {\n const { onCreateLocalStreamView, onDisposeLocalStreamView } = props;\n const onCreateStreamView = useMemo(\n () => (options?: VideoStreamOptions) => {\n return onCreateLocalStreamView?.(options);\n },\n [onCreateLocalStreamView]\n );\n const onDisposeStreamView = useMemo(\n () => () => {\n onDisposeLocalStreamView?.();\n },\n [onDisposeLocalStreamView]\n );\n return useVideoStreamLifecycleMaintainer({\n ...props,\n onCreateStreamView,\n onDisposeStreamView\n });\n};\n\n/** @private */\nexport interface RemoteVideoStreamLifecycleMaintainerProps extends VideoStreamLifecycleMaintainerExtendableProps {\n onCreateRemoteStreamView?: (\n userId: string,\n options?: VideoStreamOptions\n ) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeRemoteStreamView?: (userId: string) => Promise<void>;\n remoteParticipantId: string;\n}\n\n/**\n * Extension of {@link useVideoStreamLifecycleMaintainer} specifically for remote video streams\n *\n * @private\n */\nexport const useRemoteVideoStreamLifecycleMaintainer = (props: RemoteVideoStreamLifecycleMaintainerProps): void => {\n const { remoteParticipantId, onCreateRemoteStreamView, onDisposeRemoteStreamView } = props;\n const onCreateStreamView = useMemo(\n () => (options?: VideoStreamOptions) => {\n return onCreateRemoteStreamView?.(remoteParticipantId, options);\n },\n [onCreateRemoteStreamView, remoteParticipantId]\n );\n const onDisposeStreamView = useMemo(\n () => () => {\n onDisposeRemoteStreamView?.(remoteParticipantId);\n },\n [onDisposeRemoteStreamView, remoteParticipantId]\n );\n\n return useVideoStreamLifecycleMaintainer({\n ...props,\n onCreateStreamView,\n onDisposeStreamView\n });\n};\n"]}
1
+ {"version":3,"file":"useVideoStreamLifecycleMaintainer.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAiBrD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,iCAAiC,GAAG,CACxC,KAA0C,EACD,EAAE;IAC3C,MAAM,EACJ,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACZ,GAAG,KAAK,CAAC;IAEV,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GAAG,QAAQ,EAA2C,CAAC;IAE9G,SAAS,CAAC,GAAG,EAAE;;QACb,IAAI,iBAAiB,IAAI,CAAC,mBAAmB,EAAE;YAC7C,MAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAG,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,0CAAE,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;gBACjE,MAAM,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;YAC7C,CAAC,CAAC,CAAC;SACJ;QAED,mFAAmF;QACnF,OAAO,GAAG,EAAE;YACV,IAAI,mBAAmB,EAAE;gBACvB,wFAAwF;gBACxF,IAAI,CAAC,iBAAiB,EAAE;oBACtB,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,EAAI,CAAC;iBACzB;aACF;QACH,CAAC,CAAC;IACJ,CAAC,EAAE;QACD,UAAU;QACV,iBAAiB;QACjB,iBAAiB;QACjB,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E,CAAC,CAAC,OAA4B,EAAE,EAAE;QACrC,OAAO,wBAAwB,aAAxB,wBAAwB,uBAAxB,wBAAwB,CAAG,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC,EACD,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,CAChD,CAAC;IACF,MAAM,mBAAmB,GAAG,OAAO,CACjC,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,yBAAyB,aAAzB,yBAAyB,uBAAzB,yBAAyB,CAAG,mBAAmB,CAAC,CAAC;IACnD,CAAC,EACD,CAAC,yBAAyB,EAAE,mBAAmB,CAAC,CACjD,CAAC;IAEF,OAAO,iCAAiC,iCACnC,KAAK,KACR,kBAAkB;QAClB,mBAAmB,IACnB,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { useEffect, useMemo, useState } from 'react';\nimport { VideoStreamOptions, CreateVideoStreamViewResult, ViewScalingMode } from '../../types';\n\n/** @private */\nexport interface VideoStreamLifecycleMaintainerExtendableProps {\n isStreamAvailable?: boolean;\n renderElementExists?: boolean;\n isMirrored?: boolean;\n scalingMode?: ViewScalingMode;\n isScreenSharingOn?: boolean;\n}\n\ninterface VideoStreamLifecycleMaintainerProps extends VideoStreamLifecycleMaintainerExtendableProps {\n onCreateStreamView: (options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult> | undefined;\n onDisposeStreamView: () => void | undefined;\n}\n\n/**\n * Helper hook to maintain the video stream lifecycle. This calls onCreateStreamView and onDisposeStreamView\n * appropriately based on react lifecycle events and prop changes.\n *\n * @remarks\n *\n * Notes on handling changes to scaling mode:\n *\n * Ideally we have access to the original StreamRenderView and can call view.updateScalingMode() and do not need to recreate the stream view.\n * However, to support backwards compat we cannot guarantee this. If we don't have access to the original StreamRenderView we need to dispose\n * the old view and create a new one.\n *\n * Supporting both of these scenarios became too complex and fragile. When we introduce a breaking change this should be update to ensure that\n * onCreateStreamView _must_ return a view object with updateScalingMode and update logic in this hook to call view.updateScalingMode instead\n * of recreating the stream.\n *\n * @private\n */\nconst useVideoStreamLifecycleMaintainer = (\n props: VideoStreamLifecycleMaintainerProps\n): CreateVideoStreamViewResult | undefined => {\n const {\n isMirrored,\n isScreenSharingOn,\n isStreamAvailable,\n onCreateStreamView,\n onDisposeStreamView,\n renderElementExists,\n scalingMode\n } = props;\n\n const [videoStreamViewResult, setVideoStreamViewResult] = useState<CreateVideoStreamViewResult | undefined>();\n\n useEffect(() => {\n if (isStreamAvailable && !renderElementExists) {\n onCreateStreamView?.({ isMirrored, scalingMode })?.then((result) => {\n result && setVideoStreamViewResult(result);\n });\n }\n\n // Always clean up element to make tile up to date and be able to dispose correctly\n return () => {\n if (renderElementExists) {\n // TODO: Remove `if isScreenSharingOn` when we isolate dispose behavior for screen share\n if (!isScreenSharingOn) {\n onDisposeStreamView?.();\n }\n }\n };\n }, [\n isMirrored,\n isScreenSharingOn,\n isStreamAvailable,\n onCreateStreamView,\n onDisposeStreamView,\n renderElementExists,\n scalingMode\n ]);\n\n // The execution order for above useEffect is onCreateRemoteStreamView =>(async time gap) RenderElement generated => element disposed => onDisposeRemoteStreamView\n // Element disposed could happen during async time gap, which still cause leaks for unused renderElement.\n // Need to do an entire cleanup when remoteTile gets disposed and make sure element gets correctly disposed\n useEffect(() => {\n return () => {\n // TODO: Remove `if isScreenSharingOn` when we isolate dispose behavior for screen share\n if (!isScreenSharingOn) {\n onDisposeStreamView?.();\n }\n };\n }, [isScreenSharingOn, onDisposeStreamView]);\n\n return videoStreamViewResult;\n};\n\n/** @private */\nexport interface LocalVideoStreamLifecycleMaintainerProps extends VideoStreamLifecycleMaintainerExtendableProps {\n onCreateLocalStreamView?: (options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeLocalStreamView?: () => void;\n}\n\n/**\n * Extension of {@link useVideoStreamLifecycleMaintainer} specifically for local video streams\n *\n * @private\n */\nexport const useLocalVideoStreamLifecycleMaintainer = (\n props: LocalVideoStreamLifecycleMaintainerProps\n): CreateVideoStreamViewResult | undefined => {\n const { onCreateLocalStreamView, onDisposeLocalStreamView } = props;\n const onCreateStreamView = useMemo(\n () => (options?: VideoStreamOptions) => {\n return onCreateLocalStreamView?.(options);\n },\n [onCreateLocalStreamView]\n );\n const onDisposeStreamView = useMemo(\n () => () => {\n onDisposeLocalStreamView?.();\n },\n [onDisposeLocalStreamView]\n );\n return useVideoStreamLifecycleMaintainer({\n ...props,\n onCreateStreamView,\n onDisposeStreamView\n });\n};\n\n/** @private */\nexport interface RemoteVideoStreamLifecycleMaintainerProps extends VideoStreamLifecycleMaintainerExtendableProps {\n onCreateRemoteStreamView?: (\n userId: string,\n options?: VideoStreamOptions\n ) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeRemoteStreamView?: (userId: string) => Promise<void>;\n remoteParticipantId: string;\n}\n\n/**\n * Extension of {@link useVideoStreamLifecycleMaintainer} specifically for remote video streams\n *\n * @private\n */\nexport const useRemoteVideoStreamLifecycleMaintainer = (\n props: RemoteVideoStreamLifecycleMaintainerProps\n): CreateVideoStreamViewResult | undefined => {\n const { remoteParticipantId, onCreateRemoteStreamView, onDisposeRemoteStreamView } = props;\n const onCreateStreamView = useMemo(\n () => (options?: VideoStreamOptions) => {\n return onCreateRemoteStreamView?.(remoteParticipantId, options);\n },\n [onCreateRemoteStreamView, remoteParticipantId]\n );\n const onDisposeStreamView = useMemo(\n () => () => {\n onDisposeRemoteStreamView?.(remoteParticipantId);\n },\n [onDisposeRemoteStreamView, remoteParticipantId]\n );\n\n return useVideoStreamLifecycleMaintainer({\n ...props,\n onCreateStreamView,\n onDisposeStreamView\n });\n};\n"]}
@@ -0,0 +1,16 @@
1
+ import { IContextualMenuProps } from '@fluentui/react';
2
+ import { VideoGalleryRemoteParticipant, ViewScalingMode } from '../../types';
3
+ /**
4
+ * @private
5
+ */
6
+ export declare const useVideoTileContextualMenuProps: (props: {
7
+ remoteParticipant: VideoGalleryRemoteParticipant;
8
+ strings?: {
9
+ fitRemoteParticipantToFrame?: string | undefined;
10
+ fillRemoteParticipantFrame?: string | undefined;
11
+ } | undefined;
12
+ view?: {
13
+ updateScalingMode: (scalingMode: ViewScalingMode) => Promise<void>;
14
+ } | undefined;
15
+ }) => IContextualMenuProps | undefined;
16
+ //# sourceMappingURL=useVideoTileContextualMenuProps.d.ts.map
@@ -0,0 +1,52 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ import { useMemo } from 'react';
4
+ /**
5
+ * @private
6
+ */
7
+ export const useVideoTileContextualMenuProps = (props) => {
8
+ var _a;
9
+ const { view, strings } = props;
10
+ const scalingMode = useMemo(() => {
11
+ var _a;
12
+ /* @conditional-compile-remove(pinned-participants) */
13
+ return (_a = props.remoteParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.scalingMode;
14
+ return undefined;
15
+ }, [
16
+ /* @conditional-compile-remove(pinned-participants) */
17
+ (_a = props.remoteParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.scalingMode
18
+ ]);
19
+ const contextualMenuProps = useMemo(() => {
20
+ const items = [];
21
+ if (scalingMode) {
22
+ if (scalingMode === 'Crop' && (strings === null || strings === void 0 ? void 0 : strings.fitRemoteParticipantToFrame)) {
23
+ items.push({
24
+ key: 'fitRemoteParticipantToFrame',
25
+ text: strings.fitRemoteParticipantToFrame,
26
+ iconProps: { iconName: 'VideoTileScaleFit', styles: { root: { lineHeight: '1rem' } } },
27
+ onClick: () => {
28
+ view === null || view === void 0 ? void 0 : view.updateScalingMode('Fit');
29
+ }
30
+ });
31
+ }
32
+ else if (scalingMode === 'Fit' && (strings === null || strings === void 0 ? void 0 : strings.fillRemoteParticipantFrame)) {
33
+ {
34
+ items.push({
35
+ key: 'fillRemoteParticipantFrame',
36
+ text: strings.fillRemoteParticipantFrame,
37
+ iconProps: { iconName: 'VideoTileScaleFill', styles: { root: { lineHeight: '1rem' } } },
38
+ onClick: () => {
39
+ view === null || view === void 0 ? void 0 : view.updateScalingMode('Crop');
40
+ }
41
+ });
42
+ }
43
+ }
44
+ }
45
+ if (items.length === 0) {
46
+ return undefined;
47
+ }
48
+ return { items };
49
+ }, [scalingMode, strings, view]);
50
+ return contextualMenuProps;
51
+ };
52
+ //# sourceMappingURL=useVideoTileContextualMenuProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVideoTileContextualMenuProps.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,KAO/C,EAAoC,EAAE;;IACrC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAChC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE;;QAC/B,sDAAsD;QACtD,OAAO,MAAA,KAAK,CAAC,iBAAiB,CAAC,WAAW,0CAAE,WAAW,CAAC;QACxD,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE;QACD,sDAAsD;QACtD,MAAA,KAAK,CAAC,iBAAiB,CAAC,WAAW,0CAAE,WAAW;KACjD,CAAC,CAAC;IAEH,MAAM,mBAAmB,GAAqC,OAAO,CAAC,GAAG,EAAE;QACzE,MAAM,KAAK,GAA0B,EAAE,CAAC;QACxC,IAAI,WAAW,EAAE;YACf,IAAI,WAAW,KAAK,MAAM,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,2BAA2B,CAAA,EAAE;gBAClE,KAAK,CAAC,IAAI,CAAC;oBACT,GAAG,EAAE,6BAA6B;oBAClC,IAAI,EAAE,OAAO,CAAC,2BAA2B;oBACzC,SAAS,EAAE,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;oBACtF,OAAO,EAAE,GAAG,EAAE;wBACZ,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;oBACjC,CAAC;iBACF,CAAC,CAAC;aACJ;iBAAM,IAAI,WAAW,KAAK,KAAK,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,0BAA0B,CAAA,EAAE;gBACvE;oBACE,KAAK,CAAC,IAAI,CAAC;wBACT,GAAG,EAAE,4BAA4B;wBACjC,IAAI,EAAE,OAAO,CAAC,0BAA0B;wBACxC,SAAS,EAAE,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;wBACvF,OAAO,EAAE,GAAG,EAAE;4BACZ,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;wBAClC,CAAC;qBACF,CAAC,CAAC;iBACJ;aACF;SACF;QACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAEjC,OAAO,mBAAmB,CAAC;AAC7B,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { IContextualMenuItem, IContextualMenuProps } from '@fluentui/react';\nimport { useMemo } from 'react';\nimport { VideoGalleryRemoteParticipant, ViewScalingMode } from '../../types';\n\n/**\n * @private\n */\nexport const useVideoTileContextualMenuProps = (props: {\n remoteParticipant: VideoGalleryRemoteParticipant;\n strings?: {\n fitRemoteParticipantToFrame?: string;\n fillRemoteParticipantFrame?: string;\n };\n view?: { updateScalingMode: (scalingMode: ViewScalingMode) => Promise<void> };\n}): IContextualMenuProps | undefined => {\n const { view, strings } = props;\n const scalingMode = useMemo(() => {\n /* @conditional-compile-remove(pinned-participants) */\n return props.remoteParticipant.videoStream?.scalingMode;\n return undefined;\n }, [\n /* @conditional-compile-remove(pinned-participants) */\n props.remoteParticipant.videoStream?.scalingMode\n ]);\n\n const contextualMenuProps: IContextualMenuProps | undefined = useMemo(() => {\n const items: IContextualMenuItem[] = [];\n if (scalingMode) {\n if (scalingMode === 'Crop' && strings?.fitRemoteParticipantToFrame) {\n items.push({\n key: 'fitRemoteParticipantToFrame',\n text: strings.fitRemoteParticipantToFrame,\n iconProps: { iconName: 'VideoTileScaleFit', styles: { root: { lineHeight: '1rem' } } },\n onClick: () => {\n view?.updateScalingMode('Fit');\n }\n });\n } else if (scalingMode === 'Fit' && strings?.fillRemoteParticipantFrame) {\n {\n items.push({\n key: 'fillRemoteParticipantFrame',\n text: strings.fillRemoteParticipantFrame,\n iconProps: { iconName: 'VideoTileScaleFill', styles: { root: { lineHeight: '1rem' } } },\n onClick: () => {\n view?.updateScalingMode('Crop');\n }\n });\n }\n }\n }\n if (items.length === 0) {\n return undefined;\n }\n\n return { items };\n }, [scalingMode, strings, view]);\n\n return contextualMenuProps;\n};\n"]}
@@ -34,6 +34,10 @@ export interface VideoGalleryStrings {
34
34
  localVideoSelectedDescription: string;
35
35
  /** placeholder text for participants who does not have a display name*/
36
36
  displayNamePlaceholder: string;
37
+ /** Menu text shown in Video Tile contextual menu for setting a remote participants video to fit in frame */
38
+ fitRemoteParticipantToFrame: string;
39
+ /** Menu text shown in Video Tile contextual menu for setting a remote participants video to fill the frame */
40
+ fillRemoteParticipantFrame: string;
37
41
  }
38
42
  /**
39
43
  * @public
@@ -112,6 +116,11 @@ export interface VideoGalleryProps {
112
116
  * Camera control information for button to switch cameras.
113
117
  */
114
118
  localVideoCameraCycleButtonProps?: LocalVideoCameraCycleButtonProps;
119
+ /**
120
+ * Whether to show the remote video tile contextual menu.
121
+ * @defaultValue `true`
122
+ */
123
+ showRemoteVideoTileContextualMenu?: boolean;
115
124
  }
116
125
  /**
117
126
  * VideoGallery represents a layout of video tiles for a specific call.
@@ -38,7 +38,7 @@ export const VideoGallery = (props) => {
38
38
  const ids = useIdentifiers();
39
39
  const theme = useTheme();
40
40
  const localeStrings = useLocale().strings.videoGallery;
41
- const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
41
+ const strings = useMemo(() => (Object.assign(Object.assign({}, localeStrings), props.strings)), [localeStrings, props.strings]);
42
42
  const shouldFloatLocalVideo = !!(layout === 'floatingLocalVideo' && remoteParticipants.length > 0);
43
43
  const containerRef = useRef(null);
44
44
  const containerWidth = _useContainerWidth(containerRef);
@@ -87,10 +87,21 @@ export const VideoGallery = (props) => {
87
87
  ]);
88
88
  const defaultOnRenderVideoTile = useCallback((participant, isVideoParticipant) => {
89
89
  const remoteVideoStream = participant.videoStream;
90
- return (React.createElement(_RemoteVideoTile, Object.assign({ key: participant.userId }, participant, { onCreateRemoteStreamView: isVideoParticipant ? onCreateRemoteStreamView : undefined, onDisposeRemoteStreamView: isVideoParticipant ? onDisposeRemoteStreamView : undefined, isAvailable: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isAvailable : false, isReceiving: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isReceiving : false, renderElement: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.renderElement : undefined, remoteVideoViewOptions: isVideoParticipant ? remoteVideoViewOptions : undefined, onRenderAvatar: onRenderAvatar, showMuteIndicator: showMuteIndicator,
90
+ return (React.createElement(_RemoteVideoTile, { key: participant.userId, userId: participant.userId, remoteParticipant: participant, onCreateRemoteStreamView: isVideoParticipant ? onCreateRemoteStreamView : undefined, onDisposeRemoteStreamView: isVideoParticipant ? onDisposeRemoteStreamView : undefined, isAvailable: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isAvailable : false, isReceiving: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isReceiving : false, renderElement: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.renderElement : undefined, remoteVideoViewOptions: isVideoParticipant ? remoteVideoViewOptions : undefined, onRenderAvatar: onRenderAvatar, showMuteIndicator: showMuteIndicator, strings: strings,
91
91
  /* @conditional-compile-remove(PSTN-calls) */
92
- participantState: participant.state })));
93
- }, [onCreateRemoteStreamView, onDisposeRemoteStreamView, remoteVideoViewOptions, onRenderAvatar, showMuteIndicator]);
92
+ participantState: participant.state,
93
+ /* @conditional-compile-remove(pinned-participants) */
94
+ showRemoteVideoTileContextualMenu: props.showRemoteVideoTileContextualMenu }));
95
+ }, [
96
+ onCreateRemoteStreamView,
97
+ onDisposeRemoteStreamView,
98
+ remoteVideoViewOptions,
99
+ onRenderAvatar,
100
+ showMuteIndicator,
101
+ strings,
102
+ /* @conditional-compile-remove(pinned-participants) */
103
+ props.showRemoteVideoTileContextualMenu
104
+ ]);
94
105
  const screenShareParticipant = remoteParticipants.find((participant) => { var _a; return (_a = participant.screenShareStream) === null || _a === void 0 ? void 0 : _a.isAvailable; });
95
106
  const localScreenShareStreamComponent = React.createElement(LocalScreenShare, { localParticipant: localParticipant });
96
107
  const remoteScreenShareComponent = screenShareParticipant && (React.createElement(RemoteScreenShare, Object.assign({}, screenShareParticipant, { renderElement: (_a = screenShareParticipant.screenShareStream) === null || _a === void 0 ? void 0 : _a.renderElement, onCreateRemoteStreamView: onCreateRemoteStreamView, onDisposeRemoteStreamView: onDisposeRemoteStreamView, isReceiving: (_b = screenShareParticipant.screenShareStream) === null || _b === void 0 ? void 0 : _b.isReceiving })));