主要是用setTimeout函数控制结束,还要考虑this指代的作用域
wxml文件
<!--index.wxml-->
<view class='camera'>
<image src="/images/border.png" mode="widthFix"></image>
<camera wx:if="{
{isAuth}}" device-position="front" flash="off" binderror="error"></camera>
</view>
<button class="takePhoto" type="primary" bindtap="startShootVideo">录像</button>
wxss文件
/**index.wxss**/
.camera {
width: 430rpx;
height: 430rpx;
border-radius: 50%;
margin: 20px auto 0;
position: relative;
}
.camera image {
position: absolute;
width: 100%;
height: 100%;
z-index: 10;
}
.camera camera {
width: 430rpx;
height: 430rpx;
}
button.takePhoto:not([size='mini']) {
position: fixed;
bottom: 0;
left: 0;
widt