Stop devices from automatically sleeping

A TypeScript upgrade was necessary to bring in the types for the wake lock API.
This commit is contained in:
Robin Townsend
2023-07-21 00:51:07 -04:00
parent e4f2d86fcc
commit c0eeb035c8
4 changed files with 202 additions and 245 deletions

View File

@@ -83,6 +83,7 @@ import { useFullscreen } from "./useFullscreen";
import { useLayoutStates } from "../video-grid/Layout";
import { useSFUConfig } from "../livekit/OpenIDLoader";
import { E2EELock } from "../E2EELock";
import { useWakeLock } from "../useWakeLock";
const canScreenshare = "getDisplayMedia" in (navigator.mediaDevices ?? {});
// There is currently a bug in Safari our our code with cloning and sending MediaStreams
@@ -132,6 +133,7 @@ export function InCallView({
}: InCallViewProps) {
const { t } = useTranslation();
usePreventScroll();
useWakeLock();
const containerRef1 = useRef<HTMLDivElement | null>(null);
const [containerRef2, bounds] = useMeasure({ polyfill: ResizeObserver });