History mobile: let zoom fill splitter-created headroom

(cherry picked from commit 36936707451d9b6aa9281b680fab3b8370d4440f)
This commit is contained in:
nrlcode 2026-03-24 14:00:58 -07:00
parent f6bde23dc5
commit 7cc235ae93
3 changed files with 28 additions and 10 deletions

View File

@ -38,6 +38,7 @@ export interface HlsSource {
type HlsVideoPlayerProps = { type HlsVideoPlayerProps = {
videoRef: MutableRefObject<HTMLVideoElement | null>; videoRef: MutableRefObject<HTMLVideoElement | null>;
videoClassName?: string;
containerRef?: React.MutableRefObject<HTMLDivElement | null>; containerRef?: React.MutableRefObject<HTMLDivElement | null>;
visible: boolean; visible: boolean;
currentSource: HlsSource; currentSource: HlsSource;
@ -64,6 +65,7 @@ type HlsVideoPlayerProps = {
export default function HlsVideoPlayer({ export default function HlsVideoPlayer({
videoRef, videoRef,
videoClassName,
containerRef, containerRef,
visible, visible,
currentSource, currentSource,
@ -441,7 +443,12 @@ export default function HlsVideoPlayer({
)} )}
<video <video
ref={videoRef} ref={videoRef}
className={`size-full rounded-lg bg-black md:rounded-2xl ${loadedMetadata ? "" : "invisible"} cursor-pointer`} className={cn(
"size-full rounded-lg bg-black md:rounded-2xl",
loadedMetadata ? "" : "invisible",
"cursor-pointer",
videoClassName,
)}
preload="auto" preload="auto"
autoPlay autoPlay
controls={!frigateControls} controls={!frigateControls}

View File

@ -83,6 +83,7 @@ function playbackSessionReducer(
*/ */
type DynamicVideoPlayerProps = { type DynamicVideoPlayerProps = {
className?: string; className?: string;
videoClassName?: string;
camera: string; camera: string;
timeRange: TimeRange; timeRange: TimeRange;
cameraPreviews: Preview[]; cameraPreviews: Preview[];
@ -102,6 +103,7 @@ type DynamicVideoPlayerProps = {
}; };
export default function DynamicVideoPlayer({ export default function DynamicVideoPlayer({
className, className,
videoClassName,
camera, camera,
timeRange, timeRange,
cameraPreviews, cameraPreviews,
@ -387,6 +389,7 @@ export default function DynamicVideoPlayer({
{source && ( {source && (
<HlsVideoPlayer <HlsVideoPlayer
videoRef={playerRef} videoRef={playerRef}
videoClassName={videoClassName}
containerRef={containerRef} containerRef={containerRef}
visible={ visible={
!isScrubbing && !isScrubbing &&

View File

@ -413,6 +413,7 @@ export function RecordingView({
() => !isDesktop && mainLayoutHeight > mainLayoutWidth, () => !isDesktop && mainLayoutHeight > mainLayoutWidth,
[mainLayoutHeight, mainLayoutWidth], [mainLayoutHeight, mainLayoutWidth],
); );
const usePortraitSplitLayout = isMobilePortraitStacked && !fullscreen;
const updateMobileSplitFromClientY = useCallback( const updateMobileSplitFromClientY = useCallback(
(clientY: number) => { (clientY: number) => {
@ -897,17 +898,21 @@ export function RecordingView({
useHeightBased useHeightBased
? "h-full" ? "h-full"
: "w-full" : "w-full"
: cn( : usePortraitSplitLayout
"flex-shrink-0 portrait:w-full landscape:h-full", ? "size-full"
mainCameraAspect == "wide" : cn(
? "aspect-wide" "flex-shrink-0 portrait:w-full landscape:h-full",
: mainCameraAspect == "tall" mainCameraAspect == "wide"
? "aspect-tall portrait:h-full" ? "aspect-wide"
: "aspect-video", : mainCameraAspect == "tall"
), ? "aspect-tall portrait:h-full"
: "aspect-video",
),
)} )}
style={{ style={{
aspectRatio: getCameraAspect(mainCamera), aspectRatio: usePortraitSplitLayout
? undefined
: getCameraAspect(mainCamera),
}} }}
> >
{(isDesktop || isTablet) && ( {(isDesktop || isTablet) && (
@ -921,6 +926,9 @@ export function RecordingView({
<DynamicVideoPlayer <DynamicVideoPlayer
className={grow} className={grow}
videoClassName={
usePortraitSplitLayout ? "object-contain" : undefined
}
camera={mainCamera} camera={mainCamera}
timeRange={currentTimeRange} timeRange={currentTimeRange}
cameraPreviews={allPreviews ?? []} cameraPreviews={allPreviews ?? []}