Skip to content

Commit 71e74dc

Browse files
authored
[Calling][Bug] Fix the pptlive overlay (#4446)
1 parent 2ce7130 commit 71e74dc

3 files changed

Lines changed: 49 additions & 1 deletion

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Remove PPTLive overlay",
5+
"comment": "Remove PPTLive overlay",
6+
"packageName": "@azure/communication-react",
7+
"email": "93549644+ShaunaSong@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Remove PPTLive overlay",
5+
"comment": "Remove PPTLive overlay",
6+
"packageName": "@azure/communication-react",
7+
"email": "93549644+ShaunaSong@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}

packages/react-components/src/components/VideoTile.tsx

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
Stack,
1313
Text
1414
} from '@fluentui/react';
15-
import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
15+
import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
1616
import { useIdentifiers } from '../identifiers';
1717
import { ComponentLocale, useLocale } from '../localization';
1818
import { useTheme } from '../theming';
@@ -296,6 +296,36 @@ export const VideoTile = (props: VideoTileProps): JSX.Element => {
296296
return () => currentObserver.disconnect();
297297
}, [videoTileRef]);
298298

299+
/* @conditional-compile-remove(ppt-live) */
300+
// TODO: Remove after calling sdk fix the keybaord focus
301+
useEffect(() => {
302+
// PPTLive display name is undefined, return as it is not screen share
303+
if (displayName !== undefined) {
304+
return;
305+
}
306+
let observer: MutationObserver | undefined;
307+
if (videoTileRef.current) {
308+
observer = new MutationObserver((mutationsList) => {
309+
for (const mutation of mutationsList) {
310+
if (mutation.type === 'childList') {
311+
const iframe = document.querySelector('iframe');
312+
if (iframe) {
313+
if (!iframe.getAttribute('tabIndex')) {
314+
iframe.setAttribute('tabIndex', '-1');
315+
}
316+
}
317+
}
318+
}
319+
});
320+
321+
observer.observe(videoTileRef.current, { childList: true, subtree: true });
322+
}
323+
324+
return () => {
325+
observer?.disconnect();
326+
};
327+
}, [displayName, renderElement]);
328+
299329
const useLongPressProps = useMemo(() => {
300330
return {
301331
onLongPress: () => {

0 commit comments

Comments
 (0)