I am currently working on an Angular 6 project where I am live streaming a user's webcam to an HTML element.
My goal is to simulate the experience of capturing a video or photo on a mobile device. However, the size of the video is currently small. I would like to adjust it to fit the entire available height/width without distorting or stretching it, if possible.
.component.html
<div fxFlexFill fxLayout="column" class="videoContainer">
<video #video autoplay></video>
</div>
<button class="lv-button gradient-theme" (click)="start()" [disabled]="started">Start</button>
.component.scss
video {
border: 1px solid black;
height: 80vh;
}
button {
padding: 12px 25px;
color: white;
font-size: 15px;
font-weight: 300;
width: 100%;
}
https://i.sstatic.net/gsc95.png
Currently, the screen is black because I covered the camera. I want the display to fill the entire height of the container without stretching. I have experimented with using object-fit: cover
, but this results in cutting out/zooming in the video.