packages icon indicating copy to clipboard operation
packages copied to clipboard

[camera_web] Fixed crashing bug on camera_web 0.3.5 for Safari

Open jalen-videotape opened this issue 1 month ago • 1 comments

On certain browsers (Safari), getting facingMode on video track capabilities is not supported. The code first checks if facingMode is available on MediaTrackSettings using facingModeNullable but when the code checks for facingMode on MediaTrackCapabilities, it uses the non nullable facingMode getter instead of facingModeNullable. This causes a crash and the camera isn't initialized correctly.

This is a blocker for reliably deploying camera_web 0.3.5 which enables people to use WASM with camera functionality.

Fixes https://github.com/flutter/flutter/issues/155210

Testing

Tested on Safari on Mac and iPhone with camera initialization - camera now successfully initializes where it previously failed.

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.

jalen-videotape avatar Dec 10 '25 02:12 jalen-videotape

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Dec 10 '25 02:12 google-cla[bot]