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 [loadedMetadata, setLoadedMetadata] = useState(false);
|
||||||
|
|
||||||
const handleLoadedMetadata = useCallback(() => {
|
const handleLoadedMetadata = useCallback(() => {
|
||||||
if (videoRef.current) {
|
|
||||||
setLoadedMetadata(true);
|
setLoadedMetadata(true);
|
||||||
|
if (videoRef.current) {
|
||||||
if (setLiveResolution) {
|
if (setLiveResolution) {
|
||||||
setLiveResolution({
|
setLiveResolution({
|
||||||
width: videoRef.current.videoWidth,
|
width: videoRef.current.videoWidth,
|
||||||
|
|||||||
@ -190,9 +190,18 @@ export function RecordingView({
|
|||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [currentTime, scrubbing]);
|
}, [currentTime, scrubbing]);
|
||||||
|
|
||||||
|
const [liveResolution, setLiveResolution] = useState<VideoResolutionType>({
|
||||||
|
width: 0,
|
||||||
|
height: 0,
|
||||||
|
});
|
||||||
|
|
||||||
const onSelectCamera = useCallback(
|
const onSelectCamera = useCallback(
|
||||||
(newCam: string) => {
|
(newCam: string) => {
|
||||||
setMainCamera(newCam);
|
setMainCamera(newCam);
|
||||||
|
setLiveResolution({
|
||||||
|
width: 0,
|
||||||
|
height: 0,
|
||||||
|
});
|
||||||
setPlaybackStart(currentTime);
|
setPlaybackStart(currentTime);
|
||||||
},
|
},
|
||||||
[currentTime],
|
[currentTime],
|
||||||
@ -200,11 +209,6 @@ export function RecordingView({
|
|||||||
|
|
||||||
// motion timeline data
|
// motion timeline data
|
||||||
|
|
||||||
const [liveResolution, setLiveResolution] = useState<VideoResolutionType>({
|
|
||||||
width: 0,
|
|
||||||
height: 0,
|
|
||||||
});
|
|
||||||
|
|
||||||
const getCameraAspect = useCallback(
|
const getCameraAspect = useCallback(
|
||||||
(cam: string) => {
|
(cam: string) => {
|
||||||
if (!config) {
|
if (!config) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user