Skip to content

[camera_web] Don't require enumerating cameras on web #8362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

QoLTech
Copy link

@QoLTech QoLTech commented Jan 1, 2025

Enumerating available cameras on web requires permission and activates hardware. This PR allows initializing the camera controller without having to enumerate available cameras first.

flutter/flutter#145541

Continues where #6369 left off

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I [linked to at least one issue that this PR fixes] in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].
  • I updated CHANGELOG.md to add a description of the change, [following repository CHANGELOG style], or this PR is [exempt from CHANGELOG changes].
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

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

This comment was marked as resolved.

@ditman
Copy link
Member

ditman commented Jan 7, 2025

The CLA has been signed, I'm marking the google-cla bot comment above as "resolved".

@stuartmorgan-g stuartmorgan-g added the triage-web Should be looked at in web triage label Jan 15, 2025
@QoLTech
Copy link
Author

QoLTech commented Jan 28, 2025

I am stuck here - I'm not sure how to dive into the tests to see exactly what is failing. Can anyone help me out here?

@QoLTech QoLTech force-pushed the camera-web-initialization branch from 2185930 to 8902e10 Compare January 29, 2025 21:52
@bparrishMines
Copy link
Contributor

@QoLTech You should be able to click on Details -> View more details on flutter-dashboard -> stdout [raw]. Let me know if this works for you.

It looks like one of the tests in example/integration_test/camera_test.dart is failing in the plugin:

Failure Details:
Failure in method: returns a lens direction based on the first video track settings
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═════════════════
The following StateError was thrown running a test:
Bad state: No method stub was called from within `when()`. Was a
real method called, or perhaps an extension method?

When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 307:3  throw_
package:mocktail/src/mocktail.dart.js 274:19                                 [_completeWhen]
package:mocktail/src/mocktail.dart.js 261:33                                 thenReturn
camera_test.dart.js 1639:384                                                 <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 622:19          <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 647:23          <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 541:3           _asyncStartSync
camera_test.dart.js 1645:24                                                  <fn>
package:flutter_test/src/test_text_input_key_handler.dart.js 12373:44        <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 622:19          <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 647:23          <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 593:31          <fn>
dart-sdk/lib/async/zone.dart 1538:47                                         _rootRunUnary
dart-sdk/lib/async/zone.dart 1429:19                                         runUnary
dart-sdk/lib/async/future_impl.dart 208:18                                   handleValue
dart-sdk/lib/async/future_impl.dart 932:44                                   handleValueCallback
dart-sdk/lib/async/future_impl.dart 961:13                                   _propagateToListeners
dart-sdk/lib/async/future_impl.dart 712:5                                    [_completeWithValue]
dart-sdk/lib/async/future_impl.dart 792:7                                    <fn>
dart-sdk/lib/async/zone.dart 1525:13                                         _rootRun
dart-sdk/lib/async/zone.dart 1422:19                                         run
dart-sdk/lib/async/zone.dart 1321:7                                          runGuarded
dart-sdk/lib/async/zone.dart 1362:23                                         callback
dart-sdk/lib/async/schedule_microtask.dart 40:11                             _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5                              _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 186:7           <fn>

The test description was:
  returns a lens direction based on the first video track
  settings

@stuartmorgan-g
Copy link
Contributor

From triage: @QoLTech Are you still planning on updating this PR to address the test failures discussed above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: camera platform-web triage-web Should be looked at in web triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants