basst314 / ngx-webcam

A simple Angular webcam component / pure & minimal, no flash-fallback
https://basst314.github.io/ngx-webcam/?
MIT License
231 stars 104 forks source link

Portrait & Landscape mode on smartphones #102

Closed mapys closed 3 years ago

mapys commented 3 years ago

Hi!

I'm wondering if it's possible to force the user's video stream to landscape even if they are holding the phone in a portrait position.

Here's the expected outcome when I served the app on my desktop's browser. The user's video stream - the one on the top - is on landscape Screenshot from 2020-12-04 01-27-48

Here's the actual outcome when served on mobile while holding the phone in portrait. The stream is on landscape when auto-rotate is active and the phone is held in a landscape position. 128662956_222231839279250_2111331584338240230_n

mapys commented 3 years ago

I got it. I adjusted the width and media tracking constraints for smaller devices

case SCREEN_SIZE.SM: {
          this.frameWidth = 360;
          this.frameHeight = 480;
          this.videoOptions.width = 360;
          this.videoOptions.height = 480;
          break;
        }