livekit / client-sdk-flutter

Flutter Client SDK for LiveKit
https://docs.livekit.io
Apache License 2.0
257 stars 127 forks source link

example prejoin page camera mirror issue #615

Open AoEiuV020 opened 3 days ago

AoEiuV020 commented 3 days ago

Describe the bug When selecting the camera on the prejoin page, there is no distinction between the front and back cameras. By default, the selected camera is marked as CameraPosition.front, which causes it to display as mirrored.

Is there any way to actively choose between the front and back cameras?

When using Hardware.instance.enumerateDevices to get all devices, how can we determine whether a camera is front-facing or rear-facing?

Thank you! To Reproduce Go to the prejoin page. Select a camera (either front or back). Observe the mirror effect on the video preview. Expected behavior The front and back cameras should be clearly distinguishable when selecting, and the mirror effect should only apply to the front-facing camera. There should be a way to select which camera to use (front or back). Platform information

AoEiuV020 commented 3 days ago

After investigation, I found that the issue lies with rtc.navigator.mediaDevices.enumerateDevices(). The device information source retrieved from Android contains a "facing" property, but this property is not being passed to MediaDeviceInfo.

I would like to request the addition of this property so that when selecting a camera, users can clearly identify whether they are choosing the front-facing or rear-facing camera.

This may be considered an issue with the flutter_webrtc project. Should I submit an issue there? I noticed that the project lead is the same, so it should be quite similar, right? image