ionic-team / pwa-elements

Quality UI experiences for Web APIs that require custom UI (such as media/camera).
https://medium.com/@maxlynch/building-the-progressive-web-app-os-57daebcb69c1
MIT License
168 stars 50 forks source link

The Rear camera is not working on devices with multiple cameras #71

Open mtsmachado8 opened 3 years ago

mtsmachado8 commented 3 years ago

I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com

Current behavior: The Rear camera is not working on devices with multiple cameras

Expected behavior: It should work on S20+ and Huawey P30 Lite -> MAR-LX3A

Steps to reproduce: Use pwa-elements and capacitor core on Galaxy S20+ them try to rotate the camera to the front one. This will happen: image

Related code:

import {
  Camera,
  CameraResultType,
  CameraSource,
  CameraDirection,
} from '@capacitor/core';

const image = await Camera.getPhoto({
        resultType: CameraResultType.DataUrl,
        source: CameraSource.Camera,
        direction: CameraDirection.Rear,
        quality: 100,
      });
      const imageDataUrl = image.dataUrl;
mtsmachado8 commented 3 years ago

69 solves it