Skip to content
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

Initial camera is always initialised with wide angle sensor #531

Open
deepakg202 opened this issue Nov 12, 2024 · 0 comments
Open

Initial camera is always initialised with wide angle sensor #531

deepakg202 opened this issue Nov 12, 2024 · 0 comments

Comments

@deepakg202
Copy link

Steps to Reproduce

I am running this code

CameraAwesomeBuilder.awesome(
      sensorConfig: SensorConfig.single(
        sensor: Sensor.type(SensorType.telephoto),
      ),
      previewAlignment: Alignment.center,
      previewFit: CameraPreviewFit.fitWidth,
      enablePhysicalButton: true,
      saveConfig: SaveConfig.photo(
        pathBuilder: (sensors) async {
          final savePath = await path(CaptureMode.photo);
          return SingleCaptureRequest(savePath, sensors.first);
        },
      ),
    );

This always starts with the wide angle sensor. After looking at the source code, I updated defaultSensorType => SensorType.telephoto which kind of worked after switching camera from front to back, but initially the camera always loads with the wide angle sensor.

I see this issue opened which says lens switching is not implemented for android. But for my use case (to always start with primary camera), I forked the library and made some changes so that I can call setSensor immediately after the camera is initialised, to switch to telephoto lens which works well.

I am not sure if my phone has a telephoto sensor (most likely not) but anyway it should have used the primary sensor.

I don't know the behaviour in iOS as i don't have the device.

Expected results

It should start with a different camera sensor.

About your device

Brand Model OS
Realme GT 6T Android 14

Your flutter version

Run this in your command line
flutter --version

flutter --version
Flutter 3.27.0-0.1.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 2e2c358c9b (3 weeks ago) • 2024-10-22 11:02:13 -0400
Engine • revision af0f0d559c
Tools • Dart 3.6.0 (build 3.6.0-334.3.beta) • DevTools 2.40.1
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

No branches or pull requests

1 participant