<ar-camera ar-key="10298931" ar-type="5" flash="{{flashState}}" class="camera" bindload="loadCameraSuccess" bindmessage="message" binderror="error">
    <!--闪光灯-->
    <cover-image class="flash-button {{iphoneX ? 'flash-button-x': ''}}" s-if="{{!isRecordComplete && flashState==='on'}}" src="https://b.bdstatic.com/miniapp_cl_ar_flash_on.png" bindtap="toggleFlash"></cover-image>
    <cover-image s-if="{{!isRecordComplete && flashState==='off'}}" class="flash-button {{iphoneX ? 'flash-button-x': ''}}" src="https://b.bdstatic.com/miniapp_cl_ar_flash_off.png" bindtap="toggleFlash"></cover-image>
    <!--拍摄/录制 切换按钮 iphoneX高度要适配-->
    <cover-view s-if="{{!isNetError && !isRecordComplete}}" class="record-container {{iphoneX ? 'record-container-x': ''}}" bindtouchstart="touchStart" bindtouchend="touchEnd">
        <cover-view class="switch-camera {{cameraState==='photo'? 'photo-state':'record-state'}}">
            <cover-view></cover-view>
            <cover-view class="{{cameraState==='record'?'active':''}}" bindtap="switchToRecord">
                录制
            </cover-view>
            <cover-view class="{{cameraState==='photo'?'active':''}}" bindtap="switchToPhoto">
                拍摄
            </cover-view>
        </cover-view>
    </cover-view>
    <!--重拍，分享，保存  的按钮 iphoneX高度要适配-->
    <cover-view class="action-complete {{iphoneX ? 'action-complete-x': ''}}" s-if="isRecordComplete">
        <cover-image class="giveup-img" src="https://b.bdstatic.com/miniapp_cl_ar_back.png" bindtap="reTake" />
        <cover-image class="save-img" src="https://b.bdstatic.com/miniapp_cl_ar_save.png" bindtap="save" />
    </cover-view>
    <!--断网弹层-->
    <cover-view class="net-cover" s-if="isNetError">
        <cover-view class="net">
            <cover-view class="net-desc">网络不给力，请检查网络并重试</cover-view>
            <cover-view class="reload" bindtap="reload">重新加载</cover-view>
        </cover-view>
    </cover-view>
    <!--录像/拍摄圆形按钮。展现时机同切换录像/拍摄的按钮 iphoneX高度要适配-->
    <canvas s-if="{{!isNetError && !isRecordComplete}}" class="record-circle {{iphoneX ? 'record-circle-x': ''}}" canvas-id="recordCanvas" bindtouchstart="handleAction">
    </canvas>
</ar-camera>