Closed interim17 closed 7 months ago
Status | Category | Percentage | Covered / Total |
---|---|---|---|
π΄ | Statements | 40.51% | 2044/5045 |
π΄ | Branches | 43.53% | 845/1941 |
π΄ | Functions | 36.9% | 417/1130 |
π΄ | Lines | 40.72% | 1957/4805 |
Status of coverage: π’ - ok, π‘ - slightly more than threshold, π΄ - under the threshold
Haven't tested locally but the code changes look good. Thank you for making edits!
Thanks for review! I do want to clean up the test-bed viewer a bit so I appreciate the push to do that right.
Problem
Users of Simularium want to download mp4 video. It's already marked closed, but this addresses #240
Approach
FrameRecorder
class handles the frame by frame recording of thecanvas
. Aimed for a good separation of concerns: usingrecorder
to just record; front end handles downloading, etc.Viewport.tsx
makes an instance ofFrameRecorder
and watches for a boolean flag,recording
.recorder.onFrame()
is called in theanimate()
loop to keep frame capture tightly coupled to scene updates.Viewer.tsx
storesrecording
in state, and definesonRecordedMovie
for handling recorded the output.RecordMovieComponent
buttons and a print of recording duration, this can get fleshed out more if desired?onCompletedRecording
could also send other data if wanted, number of frames, total duration of frames, etc.There was a bug that I discussed with @toloudis that I still don't fully understand, where the
canvas
reference would go stale and return blank frames after changing Simularium files. Instantiating a newVideoEncoder
on each call ofsetup()
fixed the problem, but I'm still curious why the oldencoder
went stale, as it doesn't receive a canvas reference at all...To confirm: