Skip to content

feat: enable camera for video extenstion and microphone for recording#1493

Open
DNR500 wants to merge 1 commit into
mainfrom
enable-camera-and-microphone
Open

feat: enable camera for video extenstion and microphone for recording#1493
DNR500 wants to merge 1 commit into
mainfrom
enable-camera-and-microphone

Conversation

@DNR500

@DNR500 DNR500 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Noticed that the video extension and the sound recording need an attribute adding on the scratch iframe.

Without this you get violations in the console for the camera - or the microphone can not connect
camera-violation

microphone-not-work

Simple fix here should get it working, so the user should be accessed for permission to connect liek in the following images.

video-set-up microphone-set-up

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Scratch editor iframe configuration so that Scratch extensions requiring hardware access (camera/video sensing and microphone recording) can request permissions without triggering Permissions Policy violations.

Changes:

  • Adds allow="camera; microphone" to the Scratch iframe.
  • Updates the ScratchContainer test to validate the presence of the allow attribute.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/components/Editor/Project/ScratchContainer.jsx Enables camera and microphone permissions on the embedded Scratch iframe via the allow attribute.
src/components/Editor/Project/ScratchContainer.test.js Adds coverage asserting the iframe exposes the expected permission configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

);
expect(viewport).toHaveClass("scratch-container__viewport");
expect(iframe).toBeInTheDocument();
expect(iframe).toHaveAttribute("allow", "camera; microphone");
@DNR500 DNR500 self-assigned this Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants