我想圈出一个包含使用 webcam.js 的网络摄像头实时预览的 div。我试图把它做成一个圆圈,但只有侧面变成了圆形。
这是网络摄像头 div 的 html:
<div id="camera" class="camera" ></div>
这是css代码:
body
{
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.camera
{
width: 450px;
height: 450px;
border-radius: 50%;
overflow: hidden;
transform: rotateY(180deg);
}
这是我的 js 代码:
Webcam.set({
dest_width: 600,
dest_height: 600,
image_format: 'jpeg',
jpeg_quality: 90
});
Webcam.attach( '#camera' );