跳到主要内容

Camera

Camera component for mp

Example

bxml

 <view class="container">
<camera
style="position: absolute, height: 100vh, width: 100%, z-index: -1"
resolution="medium"
device-position="back"
flash="auto"
/>
<view class="camera-content">
This text should be on top of the camera
</view>
</view>

json

{
"backgroundColor": "#00000000"
}
  • remark - supported jssdk >= 4.11.0
  • remark - inorder to put other components behinds camera, camera component should set z-index to -1 and page background-color to transparent

Props

NameTypeDescriptionDefault
resolution`'low''medium''high'`
device-position`'front''back'`camera position, default back
flash`'auto''on''off'