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 default camera should be Rear not Front #70

Closed mtsmachado8 closed 2 years ago

mtsmachado8 commented 4 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 default camera should be Rear not Front

Expected behavior: The default camera should be Rear not Front

Steps to reproduce: Tested on galaxy S20+

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;

image

mtsmachado8 commented 4 years ago

69 solves it

jcesarmobile commented 2 years ago

This project is separate from Capacitor, despite Capacitor's Cameara depends on it, so the default doesn't have to be the same. I've sent a PR that allows to configure the camera to use, another one is needed in Camera plugin to configure the default.