Commit Graph

19 Commits

Author SHA1 Message Date
Scott Lamb 1f7c4c184a seamlessly merge minor VSE changes
Improves #302.
2024-02-12 17:35:27 -08:00
Scott Lamb 8d716bf4dd Stop using deprecated @mui/styles
I was struggling to upgrade the version of mui stuff (material and date
picker). I'm hoping getting rid of the deprecated stuff eases this a
bit.

I don't love that I can't just use sx on plain HTML stuff and have to
wrap it in Box, but oh well. Looks like I'm not alone, fwiw.
https://github.com/mui/material-ui/issues/23220
2022-10-03 08:29:11 -04:00
Scott Lamb 93792fcc57 better document TimerangeSelector
I haven't figured out how to expose its state in the URL (for #202),
but documenting how it works today seems like a good first step.
2022-03-07 13:13:32 -08:00
Scott Lamb 08109d61ce clean up App.tsx
This structure (described in
https://github.com/scottlamb/moonfire-nvr/issues/202#issue-1161741347)
has less activity-specific logic in App.tsx itself and avoids duplicate
route handling.

This fixes the `No routes matched location "/"` mentioned in #202.
2022-03-07 11:55:44 -08:00
Scott Lamb 782eb2f0d8 add some URL parameters for the list view
This is still missing the time range, which is more complex than the
others. Small steps.
2022-03-04 15:21:37 -08:00
Scott Lamb bcc59e9109 plumb more api response through to list view
This keeps a coarser-grained `toplevel` property rather than `user`
and `session`. It also synthesizes a `streams` field within it with ids.
This makes it easier to put the streams in the URL by id.
2022-03-04 12:03:47 -08:00
Scott Lamb 74b9f36a75 upgrade to @mui v5 release
This requires a bunch of package name changes. See
[https://mui.com/blog/material-ui-is-now-mui/] for their rationale.
[https://mui.com/guides/migration-v4/] lists the changes:

```
@material-ui/core -> @mui/material
@material-ui/system -> @mui/system
@material-ui/unstyled -> @mui/core
@material-ui/styles -> @mui/styles
@material-ui/icons -> @mui/icons-material
@material-ui/lab -> @mui/lab
@material-ui/types -> @mui/types
@material-ui/styled-engine -> @mui/styled-engine
@material-ui/styled-engine-sc ->@mui/styled-engine-sc
@material-ui/private-theming -> @mui/private-theming
@material-ui/codemod -> @mui/codemod
@material-ui/docs -> @mui/docs
@material-ui/envinfo -> @mui/envinfo
```

We only use a few of these.
2021-09-24 10:57:29 -07:00
Scott Lamb 27395ecd4e UI: improve aspect ratio handling
As written in the changelog: Live streams formerly worked around a
Firefox pixel aspect ratio bug by forcing all videos to 16:9, which
dramatically distorted 9:16 camera views. Playback didn't, so anamorphic
videos looked correct on Chrome but slightly stretched on Firefox. Now
both live streams and playback are fully correct on all browsers.
2021-08-12 13:33:19 -07:00
Scott Lamb 39a63e03ae upgrade material-ui to latest beta
This is a surprisingly complex upgrade. Some relevant changes from
[their CHANGELOG](https://github.com/mui-org/material-ui/blob/v5.0.0-beta.3/CHANGELOG.md):

* @material-ui/core/styles no longer re-exports some stuff from
  @material-ui/styles
* there's no more defaultTheme, so tests need to provide one
* select's onChange has a new type; match that. I haven't actually
  tried that the string form (apparently from autofill) works correctly.
* checkboxes no longer default to the secondary color; explicitly
  request this in some places.
* checkbox no longer has a checked argument; use event.target.checked
  instead.
* date pickers have switched to the new style system, so I had to
  redo how I was overridding their spacing for desktop.
* LoadingButton now has a loading property, not pending
* createMuiTheme is no createTheme
2021-08-10 12:43:10 -07:00
Scott Lamb 0236ab8d64 add live stream viewing to React prototype
It's a start. It can display several streams at once, which is nice.
There are lots of opportunities for improvement:

*   it doesn't keep the videos approximately in sync.
*   it accumulates extra buffering, drifting behind live. This is
    particularly noticeable when it's paused and played again; it can
    be several seconds before it jumps to after the break.
*   it always uses the sub stream rather main. I'd prefer it support
    "auto" (use main if the viewport is larger than the sub stream and
    there's sufficient bandwidth), "main", or "sub".
*   it has a kludgy heuristic where it throws away everything buffered 5
    seconds before the current timestamp. It should throw away
    everything before the current GOP instead, but I need to alter the
    API so it can easily know when that is.
*   it can't tell you when a camera connection is down. This needs an
    API change also.
*   it'd be nice to quickly double-click on a stream to view only it,
    then double-click again to go back to the multi-pane view.
*   it doesn't allow you to zoom in on part of the video. This would be
    nice particularly when viewing 4k video streams on small screens.
*   it has only four preconfigured layouts that subdivide a 16x9
    viewport. You have to choose every camera every time. It'd be nice
    to both allow more flexibility and have more memory.

React prototype: #111
live stream: #59
2021-03-26 16:45:47 -07:00
Scott Lamb 83369f673a snappier default display options
*   1-hour videos are a bit faster to render server-side and don't
    require so much index data to be transferred before play starts

*   the timestamp tracks might be causing a lot of excess data transfer
    in some cases. They're currently not interleaved by ascending
    timestamp, and I wonder if they should be. Chrome might be pulling
    all the bytes between the current position in the two tracks, which
    can be excessive. I'll have to consider interleaving when I add
    audio anyway. But for now, just make the default UI display
    snappier. Chrome doesn't display the timestamp track anyway, so
    don't let it slow things down.
2021-03-16 22:28:00 -07:00
Scott Lamb e272075941 cleanup unnecessary logging & such 2021-03-16 21:13:12 -07:00
Scott Lamb eb8f6f3ae1 make the video modal easier to dismiss 2021-03-16 16:43:24 -07:00
Scott Lamb 731eb8170d use menu button to show/hide selectors
Once I have more than one area of the UI (e.g., adding config, live
video, or a scrub bar prototype), I'll use this for a pull-down menu to
go between them, and maybe add a filter icon to do what this does. But
this works for now and most closely matches the old UI.

I tried to use a Collapse or Slide transition, but I had trouble getting
it to work on both desktop and mobile. In particular, the way I used the
flex wrap to display the selectors on the left/above doesn't seem
compatible with picking an orientation. If I pick the wrong orientation,
the list views won't fill the empty space.
2021-03-16 16:18:29 -07:00
Scott Lamb 4d6a8c98d9 new display options selector 2021-03-16 14:59:37 -07:00
Scott Lamb 93b0db4c28 visual improvements to list UI, tests
In particular there are fewer reflows while loading.
2021-03-15 23:26:23 -07:00
Scott Lamb 1a5e01adef display tweaks, especially for small screens 2021-03-15 11:08:02 -07:00
Scott Lamb a13733d434 trim recordings to match the requested range
This matches the default behavior of the old UI. It's not configurable.
I'm not sure anyone ever deliberately unchecked that box.
2021-03-13 22:38:21 -08:00
Scott Lamb 08c3246982 first draft of react-based list ui (#111) 2021-03-05 16:59:57 -08:00