Add canvas + audio recording feature with Start/Stop buttons #4698
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #1673
This PR adds a new feature to record the Music Blocks canvas animation along with audio as a video (.webm). This helps users, especially students, to export their mouse artwork and music performance as a downloadable video file.
What was added?
canvas.captureStream()
andaudioContext.destination.stream
to create a combined media stream.MediaRecorder
to capture and save the output as a downloadable.webm
video file.Files Modified
js/activity.js
Motivation
This solves [Issue #1673 ] which requested the ability to record the canvas drawing and music together into a video format (e.g., MP4/WebM) for easy sharing or documentation.
Demo
You can test the feature by:
http://127.0.0.1:3000/
).webm
file will automatically downloadLet me know if any improvements are needed. I'm happy to make further changes.