Group calling: tell RingRTC about our rendered resolutions for perf
This commit is contained in:
parent
b30b83ed57
commit
d1866a0e5d
16 changed files with 211 additions and 7 deletions
|
@ -44,3 +44,25 @@ export const useBoundActions = <T extends ActionCreatorsMapObject>(
|
|||
return bindActionCreators(actions, dispatch);
|
||||
}, [actions, dispatch]);
|
||||
};
|
||||
|
||||
export const usePageVisibility = (): boolean => {
|
||||
const [result, setResult] = React.useState(!document.hidden);
|
||||
|
||||
React.useEffect(() => {
|
||||
const onVisibilityChange = () => {
|
||||
setResult(!document.hidden);
|
||||
};
|
||||
|
||||
document.addEventListener('visibilitychange', onVisibilityChange, false);
|
||||
|
||||
return () => {
|
||||
document.removeEventListener(
|
||||
'visibilitychange',
|
||||
onVisibilityChange,
|
||||
false
|
||||
);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return result;
|
||||
};
|
||||
|
|
|
@ -14427,7 +14427,7 @@
|
|||
"rule": "React-useRef",
|
||||
"path": "ts/components/CallingPip.tsx",
|
||||
"line": " const localVideoRef = React.useRef(null);",
|
||||
"lineNumber": 78,
|
||||
"lineNumber": 80,
|
||||
"reasonCategory": "usageTrusted",
|
||||
"updated": "2020-10-26T19:12:24.410Z",
|
||||
"reasonDetail": "Used to get the local video element for rendering."
|
||||
|
|
12
ts/util/ringrtc/nonRenderedRemoteParticipant.ts
Normal file
12
ts/util/ringrtc/nonRenderedRemoteParticipant.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2020 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { GroupCallVideoRequest } from '../../types/Calling';
|
||||
|
||||
export const nonRenderedRemoteParticipant = ({
|
||||
demuxId,
|
||||
}: Readonly<{ demuxId: number }>): GroupCallVideoRequest => ({
|
||||
demuxId,
|
||||
width: 0,
|
||||
height: 0,
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue