mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-04-01 10:13:43 -04:00
make the video modal easier to dismiss
This commit is contained in:
parent
731eb8170d
commit
eb8f6f3ae1
@ -31,12 +31,6 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||||||
marginBottom: theme.spacing(2),
|
marginBottom: theme.spacing(2),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
video: {
|
|
||||||
objectFit: "contain",
|
|
||||||
width: "100%",
|
|
||||||
height: "100%",
|
|
||||||
background: "#000",
|
|
||||||
},
|
|
||||||
videoTable: {
|
videoTable: {
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
width: "max-content",
|
width: "max-content",
|
||||||
@ -59,6 +53,21 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// When there's a video modal up, make the content as large as possible
|
||||||
|
// without distorting it. Center it in the screen and ensure that the video
|
||||||
|
// element only takes up the space actually used by the content, so that
|
||||||
|
// clicking outside it will dismiss the modal.
|
||||||
|
videoModal: {
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
"& video": {
|
||||||
|
objectFit: "contain",
|
||||||
|
maxWidth: "100%",
|
||||||
|
maxHeight: "100%",
|
||||||
|
},
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@ -150,12 +159,11 @@ const Main = ({ cameras, timeZoneName, showMenu }: Props) => {
|
|||||||
</Box>
|
</Box>
|
||||||
{videoLists.length > 0 && recordingsTable}
|
{videoLists.length > 0 && recordingsTable}
|
||||||
{activeRecording != null && (
|
{activeRecording != null && (
|
||||||
<Modal open onClose={closeModal}>
|
<Modal open onClose={closeModal} className={classes.videoModal}>
|
||||||
<video
|
<video
|
||||||
controls
|
controls
|
||||||
preload="auto"
|
preload="auto"
|
||||||
autoPlay
|
autoPlay
|
||||||
className={classes.video}
|
|
||||||
src={api.recordingUrl(
|
src={api.recordingUrl(
|
||||||
activeRecording[0].camera.uuid,
|
activeRecording[0].camera.uuid,
|
||||||
activeRecording[0].streamType,
|
activeRecording[0].streamType,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user