Live view improvements (#10781)

* Show frigate features in bottom sheet on mobile

* Use flex wrap on mobile so the ptz icons are not cutoff

* Support opening pip from live view

* Remove unused
This commit is contained in:
Nicolas Mowen
2024-04-02 06:45:16 -06:00
committed by GitHub
parent a886b6a3e5
commit 4d8d3cd22e
4 changed files with 215 additions and 54 deletions

View File

@@ -6,6 +6,7 @@ type MSEPlayerProps = {
className?: string;
playbackEnabled?: boolean;
audioEnabled?: boolean;
pip?: boolean;
onPlaying?: () => void;
};
@@ -14,6 +15,7 @@ function MSEPlayer({
className,
playbackEnabled = true,
audioEnabled = false,
pip = false,
onPlaying,
}: MSEPlayerProps) {
let connectTS: number = 0;
@@ -268,6 +270,16 @@ function MSEPlayer({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [playbackEnabled, onDisconnect, onConnect]);
// control pip
useEffect(() => {
if (!videoRef.current || !pip) {
return;
}
videoRef.current.requestPictureInPicture();
}, [pip, videoRef]);
return (
<video
ref={videoRef}