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

Allow choosing the deviceId for Camera #1638

Open
RafaRuiz opened this issue Mar 19, 2024 · 2 comments
Open

Allow choosing the deviceId for Camera #1638

RafaRuiz opened this issue Mar 19, 2024 · 2 comments

Comments

@RafaRuiz
Copy link

RafaRuiz commented Mar 19, 2024

Describe the bug
When having 1 internal camera and one external camera, the expected results vary. I can't choose what camera to use.
While I could choose the camera I wanted on Twilio, because I only had to give its ID

To Reproduce
I'm doing:

  Future<void> _initAgora() async {
    try {
      await engine //
          .initialize(const RtcEngineContext(appId: _agoraId));

      await engine.enableVideo();
      await engine.setCameraCapturerConfiguration(const CameraCapturerConfiguration(cameraDirection: CameraDirection.cameraFront));
      await engine.startPreview();
      await engine.setClientRole(role: ClientRoleType.clientRoleBroadcaster);

    } catch(e) {
      print(e);
    }
  }

alternating with CameraDirection.cameraFront and CameraDirection.cameraRear

Expected behavior
image

Despite any third-party Android (probably iOS too) camera library can give us the current cameras we can use with its ID (as shown in the next screenshot, where IDs are "0" and "1"

image

With Twilio (for calling), or any third party camera library to preview, I could say the deviceId I wanted and that was granted.

Current Behaviour

  • When using CameraDirection.cameraFront: as expected, it's working with my front internal camera

image

  • When using CameraDirection.cameraRear: no camera, so there's no way I can choose my external webcam

image

Context
I've plugged the same external camera that Agora can't get from one tablet, into another tablet that has 0 internal cameras, and I was able to use it.

Solution
We should be able to get the available video devices on Android, get their ID, and be able to choose the camera ID we want the source from.

@plutoless
Copy link

@RafaRuiz thank you for the issue report. This is more related to our native android sdk design. let me confirm with our PM regarding this issue.

@plutoless
Copy link

@RafaRuiz i have just confirmed with our PM this will be included in sdk version 4.3.1. For further info feel free to contact our support team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants