ionic-team / ionic-team/pwa-elements

The Rear camera is not working on devices with multiple cameras

Open
#71 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
171
Forks
50
PR merge metrics
No merged PRs in 30d

Description

**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](https://user-images.githubusercontent.com/11022437/99711094-203d4980-2a80-11eb-8c04-f2258757c971.png)

**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;
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.