前言:
vue调用本地摄像头实现拍照功能,由于调用摄像头有使用权限,只能在本地运行,线上需用https域名才可以使用。实现效果:
1、摄像头效果:
2、拍照效果:
实现代码:
.camera_outer{
position: relative;
overflow: hidden;
background: url("../../assets/img/user_0608_04.jpg") no-repeat center;
background-size: 100%;
video,canvas,.tx_img{
-moz-transform:scaleX(-1);
-webkit-transform:scaleX(-1);
-o-transform:scaleX(-1);
transform:scaleX(-1);
}
.btn_camera{
position: absolute;
bottom: 4px;
left: 0;
right: 0;
height: 50px;
background-color: rgba(0,0,0,0.3);
line-height: 50px;
text-align: center;
color: #ffffff;
}
.bg_r_img{
position: absolute;
bottom: 0;
left: 0;
right: 0;
top: 0;
}
.img_bg_camera{
position: absolute;
bottom: 0;
left: 0;
right: 0;
top: 0;
img{
width: 100%;
height: 100%;
}
.img_btn_camera{
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 50px;
line-height: 50px;
text-align: center;
background-color: rgba(0,0,0,0.3);
color: #ffffff;
.loding_img{
width: 50px;
height: 50px;
}
}
}
}
总结
到此这篇关于vue调用本地摄像头实现拍照功能的文章就介绍到这了,更多相关vue调用本地摄像头实现拍照内容请搜索考高分网以前的文章或继续浏览下面的相关文章希望大家以后多多支持考高分网!



