Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix camera feed fullscreen bug #8650

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Changes from all commits
Commits
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
11 changes: 6 additions & 5 deletions src/Components/CameraFeed/CameraFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ export default function CameraFeed(props: Props) {
);

return (
<div ref={playerWrapperRef} className="flex flex-col justify-center">
<div ref={playerWrapperRef} className="flex h-full flex-col justify-center">
<div
className={classNames(
"flex max-h-screen flex-col justify-center",
"flex max-h-screen min-h-full flex-col justify-center",
props.className,
isFullscreen ? "bg-black" : "bg-zinc-100",
isIOS && isFullscreen && "px-20",
Expand All @@ -157,7 +157,7 @@ export default function CameraFeed(props: Props) {
<div
className={classNames(
isFullscreen ? "hidden lg:flex" : "flex",
"items-center justify-between px-4 py-0.5 transition-all duration-500 ease-in-out lg:py-1",
"shrink-0 items-center justify-between px-4 py-0.5 transition-all duration-500 ease-in-out lg:py-1",
(() => {
if (playerStatus !== "playing") {
return "bg-black text-zinc-400";
Expand Down Expand Up @@ -202,7 +202,7 @@ export default function CameraFeed(props: Props) {
)}
</div>
</div>
<div className="group relative aspect-video bg-black">
<div className="group relative flex-1 bg-black">
{/* Notifications */}
<FeedAlert state={state} />
{playerStatus === "playing" && <FeedWatermark />}
Expand Down Expand Up @@ -250,7 +250,7 @@ export default function CameraFeed(props: Props) {
<VideoPlayer
playerRef={playerRef}
streamUrl={streamUrl}
className="absolute inset-x-0 mx-auto aspect-video max-h-full w-full"
className="max-h-[calc(100vh-40px)] w-full object-contain"
onPlay={() => {
setPlayedOn(new Date());
setState("playing");
Expand All @@ -266,6 +266,7 @@ export default function CameraFeed(props: Props) {
}}
onError={props.onStreamError}
/>

{inlineControls && playerStatus === "playing" && controls}
</div>
{!inlineControls && (
Expand Down
Loading