From 56c4b973219f10206c87a416622ba8c0f4e23814 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 15 Mar 2024 11:12:25 -0600 Subject: [PATCH] Allow tap to toggle controls so zooming still works --- web/src/components/player/LivePlayer.tsx | 3 ++ web/src/components/player/WebRTCPlayer.tsx | 13 ++++++++- web/src/views/live/LiveCameraView.tsx | 32 ++++++++++++---------- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/web/src/components/player/LivePlayer.tsx b/web/src/components/player/LivePlayer.tsx index ae982a5ce..69ad60bd3 100644 --- a/web/src/components/player/LivePlayer.tsx +++ b/web/src/components/player/LivePlayer.tsx @@ -21,6 +21,7 @@ type LivePlayerProps = { windowVisible?: boolean; playAudio?: boolean; micEnabled?: boolean; // only webrtc supports mic + iOSCompatFullScreen?: boolean; onClick?: () => void; }; @@ -32,6 +33,7 @@ export default function LivePlayer({ windowVisible = true, playAudio = false, micEnabled = false, + iOSCompatFullScreen = false, onClick, }: LivePlayerProps) { // camera activity @@ -100,6 +102,7 @@ export default function LivePlayer({ playbackEnabled={cameraActive} audioEnabled={playAudio} microphoneEnabled={micEnabled} + iOSCompatFullScreen={iOSCompatFullScreen} onPlaying={() => setLiveReady(true)} /> ); diff --git a/web/src/components/player/WebRTCPlayer.tsx b/web/src/components/player/WebRTCPlayer.tsx index 4171947f3..a004251d6 100644 --- a/web/src/components/player/WebRTCPlayer.tsx +++ b/web/src/components/player/WebRTCPlayer.tsx @@ -1,5 +1,5 @@ import { baseUrl } from "@/api/baseUrl"; -import { useCallback, useEffect, useMemo, useRef } from "react"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; type WebRtcPlayerProps = { className?: string; @@ -7,6 +7,7 @@ type WebRtcPlayerProps = { playbackEnabled?: boolean; audioEnabled?: boolean; microphoneEnabled?: boolean; + iOSCompatFullScreen?: boolean; // ios doesn't support fullscreen divs so we must support the video element onPlaying?: () => void; }; @@ -16,6 +17,7 @@ export default function WebRtcPlayer({ playbackEnabled = true, audioEnabled = false, microphoneEnabled = false, + iOSCompatFullScreen = false, onPlaying, }: WebRtcPlayerProps) { // metadata @@ -170,14 +172,23 @@ export default function WebRtcPlayer({ microphoneEnabled, ]); + // ios compat + const [iOSCompatControls, setiOSCompatControls] = useState(false); + return (