diff --git a/change/@internal-react-components-d6a8dba5-a8a4-4f1e-816f-b94c7ef635a5.json b/change/@internal-react-components-d6a8dba5-a8a4-4f1e-816f-b94c7ef635a5.json new file mode 100644 index 00000000000..d905f56e30c --- /dev/null +++ b/change/@internal-react-components-d6a8dba5-a8a4-4f1e-816f-b94c7ef635a5.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "VideoGallery has unique identifier for local video tile to dock.", + "packageName": "@internal/react-components", + "email": "miguelgamis@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@internal-storybook-369108de-2ed0-45dc-9a76-35f091c05f27.json b/change/@internal-storybook-369108de-2ed0-45dc-9a76-35f091c05f27.json new file mode 100644 index 00000000000..84a3c7a84c6 --- /dev/null +++ b/change/@internal-storybook-369108de-2ed0-45dc-9a76-35f091c05f27.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "updated VideoGallery snapshot", + "packageName": "@internal/storybook", + "email": "miguelgamis@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/communication-react/package.json b/packages/communication-react/package.json index 643a1d9160d..89eb69724d3 100644 --- a/packages/communication-react/package.json +++ b/packages/communication-react/package.json @@ -122,8 +122,7 @@ "ts-jest": "^26.4.4", "ts-node": "^9.1.1", "ttypescript": "~1.5.12", - "typescript": "4.3.5", - "uuid": "^8.1.0" + "typescript": "4.3.5" }, "beachball": { "shouldPublish": false diff --git a/packages/react-components/package.json b/packages/react-components/package.json index deecb5d9263..8f12210e011 100644 --- a/packages/react-components/package.json +++ b/packages/react-components/package.json @@ -34,7 +34,8 @@ "@internal/acs-ui-common": "1.0.0-beta.8", "react-aria-live": "^2.0.5", "react-linkify": "^1.0.0-alpha", - "html-to-react": "~1.4.5" + "html-to-react": "~1.4.5", + "uuid": "^8.1.0" }, "peerDependencies": { "@types/react": ">=16.8.0 <18.0.0", @@ -101,7 +102,6 @@ "ts-node": "^9.1.1", "type-fest": "~1.2.1", "typescript": "4.3.5", - "uuid": "^8.1.0", "webpack": "5.38.1" } } diff --git a/packages/react-components/src/components/VideoGallery.tsx b/packages/react-components/src/components/VideoGallery.tsx index 504e1b037f8..e1d95118c7b 100644 --- a/packages/react-components/src/components/VideoGallery.tsx +++ b/packages/react-components/src/components/VideoGallery.tsx @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { concatStyleSets, ContextualMenu, IDragOptions, IStyle, mergeStyles, Modal, Stack } from '@fluentui/react'; -import React, { useCallback, useMemo, useRef } from 'react'; +import React, { useCallback, useMemo, useRef, useEffect } from 'react'; import { GridLayoutStyles } from '.'; import { smartDominantSpeakerParticipants } from '../gallery'; import { useIdentifiers } from '../identifiers/IdentifierProvider'; @@ -35,8 +35,7 @@ import { isNarrowWidth, useContainerWidth } from './utils/responsive'; import { LocalScreenShare } from './VideoGallery/LocalScreenShare'; import { RemoteScreenShare } from './VideoGallery/RemoteScreenShare'; import { VideoTile } from './VideoTile'; - -const FLOATING_TILE_HOST_ID = 'UILibraryFloatingTileHost'; +import { v4 as uuidv4 } from 'uuid'; // Currently the Calling JS SDK supports up to 4 remote video streams const DEFAULT_MAX_REMOTE_VIDEO_STREAMS = 4; @@ -303,9 +302,14 @@ export const VideoGallery = (props: VideoGalleryProps): JSX.Element => { /> ); + useEffect(() => { + if (containerRef.current) { + containerRef.current.id = `video-gallery-${uuidv4()}`; + } + }, [containerRef]); + return (