Camera does not default to rear facing camera

I am building a webapp that needs to access the rear facing camera. I’m using capacitor and setting the direction to rear but it always opens with the front facing camera. I have tested on android with chrome and IOS with safari and get the same results.

  async takePicture() {
    try {
      const profilePicture = await Camera.getPhoto({
        quality: 20,
        allowEditing: false,
        direction: CameraDirection.Rear,
        source: CameraSource.Camera,
        resultType: CameraResultType.Base64,
        
      });
      this.guestPicture = profilePicture.base64String;
    } catch (error) {
      console.error(error);
    }
  }

Is this a known issue?

My test app can be viewed Here

yeah, it’s a known issue on PWA elements that the Camera plugin internally uses

If you don’t use PWA elements (or pass webUseInput set to true, it will use an input file with capture attribute that properly sets the camera direction, but might now work on desktop browsers.