mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-05 22:57:40 +03:00
History mobile: let zoom fill splitter-created headroom
(cherry picked from commit 36936707451d9b6aa9281b680fab3b8370d4440f)
This commit is contained in:
parent
f6bde23dc5
commit
7cc235ae93
@ -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}
|
||||||
|
|||||||
@ -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 &&
|
||||||
|
|||||||
@ -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,6 +898,8 @@ export function RecordingView({
|
|||||||
useHeightBased
|
useHeightBased
|
||||||
? "h-full"
|
? "h-full"
|
||||||
: "w-full"
|
: "w-full"
|
||||||
|
: usePortraitSplitLayout
|
||||||
|
? "size-full"
|
||||||
: cn(
|
: cn(
|
||||||
"flex-shrink-0 portrait:w-full landscape:h-full",
|
"flex-shrink-0 portrait:w-full landscape:h-full",
|
||||||
mainCameraAspect == "wide"
|
mainCameraAspect == "wide"
|
||||||
@ -907,7 +910,9 @@ export function RecordingView({
|
|||||||
),
|
),
|
||||||
)}
|
)}
|
||||||
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 ?? []}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user