Merge pull request #15 from ibs0d/codex/add-camera-rotation-config-option-yo8e42

Support dashboard rotate + cover-fit for camera tiles and players
This commit is contained in:
ibs0d 2026-03-08 15:57:19 +11:00 committed by GitHub
commit 4721dd4ed0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -412,17 +412,24 @@ export default function LivePlayer({
lowerClassName="md:rounded-2xl" lowerClassName="md:rounded-2xl"
/> />
)} )}
<div {applyDashboardTransforms ? (
ref={mediaViewportRef} <div
className={cn( ref={mediaViewportRef}
"absolute inset-0", className={cn(
shouldFillContainer && "overflow-hidden", "absolute inset-0",
)} shouldFillContainer && "overflow-hidden",
> )}
<div className="absolute left-1/2 top-1/2" style={mediaTransformStyle}> >
{player} <div
className="absolute left-1/2 top-1/2"
style={mediaTransformStyle}
>
{player}
</div>
</div> </div>
</div> ) : (
player
)}
{cameraEnabled && {cameraEnabled &&
!offline && !offline &&
(!showStillWithoutActivity || isReEnabling) && (!showStillWithoutActivity || isReEnabling) &&
@ -480,33 +487,63 @@ export default function LivePlayer({
</div> </div>
)} )}
<div {applyDashboardTransforms ? (
className={cn( <div
"absolute inset-0 w-full",
showStillWithoutActivity &&
!liveReady &&
!isReEnabling &&
cameraEnabled
? "visible"
: "invisible",
)}
>
<AutoUpdatingCameraImage
className={cn( className={cn(
"pointer-events-none size-full", "absolute inset-0",
showStillWithoutActivity &&
!liveReady &&
!isReEnabling &&
cameraEnabled
? "visible"
: "invisible",
shouldFillContainer && "overflow-hidden", shouldFillContainer && "overflow-hidden",
)} )}
cameraClasses={cn( >
"relative size-full", <div
shouldFillContainer && "overflow-hidden", className="absolute left-1/2 top-1/2"
style={mediaTransformStyle}
>
<AutoUpdatingCameraImage
className={cn(
"pointer-events-none size-full",
shouldFillContainer && "overflow-hidden",
)}
cameraClasses={cn(
"relative size-full",
shouldFillContainer && "overflow-hidden",
)}
fit={shouldFillContainer ? "cover" : "contain"}
camera={cameraConfig.name}
showFps={false}
reloadInterval={stillReloadInterval}
periodicCache
/>
</div>
</div>
) : (
<div
className={cn(
"absolute inset-0 w-full",
showStillWithoutActivity &&
!liveReady &&
!isReEnabling &&
cameraEnabled
? "visible"
: "invisible",
)} )}
fit={shouldFillContainer ? "cover" : "contain"} >
camera={cameraConfig.name} <AutoUpdatingCameraImage
showFps={false} className="pointer-events-none size-full"
reloadInterval={stillReloadInterval} cameraClasses="relative size-full"
periodicCache fit="contain"
/> camera={cameraConfig.name}
</div> showFps={false}
reloadInterval={stillReloadInterval}
periodicCache
/>
</div>
)}
{offline && applyDashboardTransforms && ( {offline && applyDashboardTransforms && (
<> <>