Skip to content

Add canvas + audio recording feature with Start/Stop buttons#4698

Closed
Sauve9119 wants to merge 1 commit intosugarlabs:masterfrom
Sauve9119:add-recording-feature
Closed

Add canvas + audio recording feature with Start/Stop buttons#4698
Sauve9119 wants to merge 1 commit intosugarlabs:masterfrom
Sauve9119:add-recording-feature

Conversation

@Sauve9119
Copy link

@Sauve9119 Sauve9119 commented May 28, 2025

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?

  • Added two new buttons:
    • 🎥 "Start Recording"
    • ⏹️ "Stop Recording"
  • Used canvas.captureStream() and audioContext.destination.stream to create a combined media stream.
  • Used 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:

  1. Opening Music Blocks in browser (http://127.0.0.1:3000/)
  2. Creating some music + mouse animations
  3. Clicking "Start Recording", then "Stop Recording"
  4. A .webm file will automatically download

Let me know if any improvements are needed. I'm happy to make further changes.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@github-actions
Copy link
Contributor

This pull request has been open for more than 60 days without any activity. It will be closed in 3 days unless the stale label is removed or commented on.

@github-actions github-actions bot added the Stale label Aug 21, 2025
@Sauve9119
Copy link
Author

Maintainers, Please review the Pull Request. And remove it from the stale label

@github-actions github-actions bot removed the Stale label Aug 22, 2025
@github-actions
Copy link
Contributor

This pull request has been open for more than 60 days without any activity. It will be closed in 3 days unless the stale label is removed or commented on.

@github-actions github-actions bot added the Stale label Oct 21, 2025
@pikurasa
Copy link
Collaborator

We already have a record button, we do not need this one.

@walterbender this is what this PR looks like, when run (see upper-right).

Screenshot from 2025-10-22 11-58-02

I'm closing this.

@pikurasa pikurasa closed this Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggested feature: Export mouse animation and music together

2 participants