mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 05:35:25 +03:00
reset when changing main cam
This commit is contained in:
parent
d029507c1c
commit
20f6b7e7c1
@ -48,8 +48,8 @@ export default function HlsVideoPlayer({
|
||||
const [loadedMetadata, setLoadedMetadata] = useState(false);
|
||||
|
||||
const handleLoadedMetadata = useCallback(() => {
|
||||
if (videoRef.current) {
|
||||
setLoadedMetadata(true);
|
||||
if (videoRef.current) {
|
||||
if (setLiveResolution) {
|
||||
setLiveResolution({
|
||||
width: videoRef.current.videoWidth,
|
||||
|
||||
@ -190,9 +190,18 @@ export function RecordingView({
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [currentTime, scrubbing]);
|
||||
|
||||
const [liveResolution, setLiveResolution] = useState<VideoResolutionType>({
|
||||
width: 0,
|
||||
height: 0,
|
||||
});
|
||||
|
||||
const onSelectCamera = useCallback(
|
||||
(newCam: string) => {
|
||||
setMainCamera(newCam);
|
||||
setLiveResolution({
|
||||
width: 0,
|
||||
height: 0,
|
||||
});
|
||||
setPlaybackStart(currentTime);
|
||||
},
|
||||
[currentTime],
|
||||
@ -200,11 +209,6 @@ export function RecordingView({
|
||||
|
||||
// motion timeline data
|
||||
|
||||
const [liveResolution, setLiveResolution] = useState<VideoResolutionType>({
|
||||
width: 0,
|
||||
height: 0,
|
||||
});
|
||||
|
||||
const getCameraAspect = useCallback(
|
||||
(cam: string) => {
|
||||
if (!config) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user