Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "Fix bug where mobile video gallery shows landscape view when RTT banner is enlarged",
"comment": "Fix bug where mobile video gallery shows landscape view when RTT banner is enlarged",
"packageName": "@azure/communication-react",
"email": "96077406+carocao-msft@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "Fix bug where mobile video gallery shows landscape view when RTT banner is enlarged",
"comment": "Fix bug where mobile video gallery shows landscape view when RTT banner is enlarged",
"packageName": "@azure/communication-react",
"email": "96077406+carocao-msft@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import React, { CSSProperties, useCallback, useMemo } from 'react';
import { useRef } from 'react';
import React, { CSSProperties, useCallback, useMemo, useRef } from 'react';
import {
VideoGallery,
VideoStreamOptions,
Expand Down Expand Up @@ -71,6 +70,7 @@ export interface MediaGalleryProps {
height: 'full' | 'default';
};
localScreenShareView?: LocalScreenShareView;
compositeContainerAspectRatio?: number;
}

/**
Expand All @@ -84,7 +84,8 @@ export const MediaGallery = (props: MediaGalleryProps): JSX.Element => {
setPromptProps,
hideSpotlightButtons,
videoTilesOptions,
captionsOptions
captionsOptions,
compositeContainerAspectRatio
} = props;

const videoGalleryProps = usePropsFor(VideoGallery);
Expand All @@ -95,12 +96,11 @@ export const MediaGallery = (props: MediaGalleryProps): JSX.Element => {
const userRole = useSelector(getRole);
const capabilities = useSelector(getCapabilites);
const isRoomsCall = useSelector(getIsRoomsCall);
const reactionResources = useSelector(getReactionResources);

const containerRef = useRef<HTMLDivElement>(null);
const containerWidth = _useContainerWidth(containerRef);
const containerHeight = _useContainerHeight(containerRef);
const containerAspectRatio = containerWidth && containerHeight ? containerWidth / containerHeight : 0;
const reactionResources = useSelector(getReactionResources);

const layoutBasedOnTilePosition: VideoGalleryLayout = getVideoGalleryLayoutBasedOnLocalOptions(
(props.localVideoTileOptions as LocalVideoTileOptions)?.position
Expand Down Expand Up @@ -209,7 +209,7 @@ export const MediaGallery = (props: MediaGalleryProps): JSX.Element => {
localVideoTileSize={
props.localVideoTileOptions === false || userRole === 'Consumer' || (isRoomsCall && userRole === 'Unknown')
? 'hidden'
: props.isMobile && containerAspectRatio < 1
: props.isMobile && compositeContainerAspectRatio && compositeContainerAspectRatio < 1
? '9:16'
: '16:9'
}
Expand Down Expand Up @@ -242,7 +242,6 @@ export const MediaGallery = (props: MediaGalleryProps): JSX.Element => {
overflowGalleryPosition,
userRole,
isRoomsCall,
containerAspectRatio,
pinnedParticipants,
onPinParticipant,
onUnpinParticipant,
Expand All @@ -254,7 +253,8 @@ export const MediaGallery = (props: MediaGalleryProps): JSX.Element => {
onStopRemoteSpotlightWithPrompt,
layoutBasedOnTilePosition,
capabilities?.muteOthers,
props.localScreenShareView
props.localScreenShareView,
compositeContainerAspectRatio
]);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
import { DiagnosticQuality } from '@azure/communication-calling';
import { useId } from '@fluentui/react-hooks';
import { _isInCall } from '@internal/calling-component-bindings';
import { ActiveErrorMessage, ErrorBar, ParticipantMenuItemsCallback } from '@internal/react-components';
import {
_useContainerHeight,
_useContainerWidth,
ActiveErrorMessage,
ErrorBar,
ParticipantMenuItemsCallback
} from '@internal/react-components';
import { CustomAvatarOptions, VideoTile } from '@internal/react-components';

import { ActiveNotification } from '@internal/react-components';
import { VideoGalleryLayout } from '@internal/react-components';
import React, { useMemo } from 'react';
import React, { useMemo, useRef } from 'react';
import { useCallback } from 'react';
import { useState } from 'react';
import { AvatarPersonaDataCallback } from '../../common/AvatarPersona';
Expand Down Expand Up @@ -108,6 +114,10 @@ export const CallPage = (props: CallPageProps): JSX.Element => {
const [dtmfDialerPresent, setDtmfDialerPresent] = useState<boolean>(renderDtmfDialerFromStart);
const isPstnCall = callees?.some((callee) => isPhoneNumberIdentifier(callee));
const isCTECall = useSelector((state) => state.userId.kind === 'microsoftTeamsUser');
const containerRef = useRef<HTMLDivElement>(null);
const containerWidth = _useContainerWidth(containerRef);
const containerHeight = _useContainerHeight(containerRef);
const containerAspectRatio = containerWidth && containerHeight ? containerWidth / containerHeight : 0;

const strings = useLocale().strings.call;

Expand Down Expand Up @@ -196,13 +206,14 @@ export const CallPage = (props: CallPageProps): JSX.Element => {
videoTilesOptions={options?.videoTilesOptions}
captionsOptions={options?.captionsBanner}
localScreenShareView={options?.galleryOptions?.localScreenShareView}
compositeContainerAspectRatio={containerAspectRatio}
/>
);
}
};

return (
<>
<div ref={containerRef} style={{ height: '100%', width: '100%' }}>
<CallArrangement
id={drawerMenuHostId}
complianceBannerProps={{ ...complianceBannerProps, strings }}
Expand Down Expand Up @@ -256,7 +267,7 @@ export const CallPage = (props: CallPageProps): JSX.Element => {
isRTTSupportedCall={!isPstnCall && !isCTECall}
/>
{<Prompt isOpen={isPromptOpen} onDismiss={() => setIsPromptOpen(false)} {...promptProps} />}
</>
</div>
);
};

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.