Skip to content

Commit 4afedb9

Browse files
Leo1305PinedaLeonardoPinedajcesarmobile
authored
fix(camera): set camera direction for web (#665)
Co-authored-by: LeonardoPineda <[email protected]> Co-authored-by: Julio César <[email protected]>
1 parent 2bf99a3 commit 4afedb9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

camera/src/web.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ export class CameraWeb extends WebPlugin implements CameraPlugin {
5656
) {
5757
if (customElements.get('pwa-camera-modal')) {
5858
const cameraModal: any = document.createElement('pwa-camera-modal');
59+
cameraModal.facingMode =
60+
options.direction === CameraDirection.Front ? 'user' : 'environment';
5961
document.body.appendChild(cameraModal);
6062
try {
6163
await cameraModal.componentOnReady();

0 commit comments

Comments
 (0)