Skip to content

RN下支持camera#2262

Open
wangxiaokou wants to merge 26 commits intomasterfrom
feat-camera
Open

RN下支持camera#2262
wangxiaokou wants to merge 26 commits intomasterfrom
feat-camera

Conversation

@wangxiaokou
Copy link
Collaborator

  1. api-proxy补充createCameraContext
  2. core中增加同一个页面引入多个camera异常
  3. webpack-plugin中增加camera组件

bindstop && bindstop()
}, [bindstop])

const camera: CameraRef = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

包裹个useMemo只需要创建一次

layoutRef
}
)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camera = useMemo(()=>{
return {...}
}, [])

useEffect(()=>{
return ()=>{
if(navigation.camera === camera){
delete navigation.camera
}
}
}, [])

if(navigation.camera && navigation.camera !== camera ) {
warn()
return null
} else {
navigation.camera = camera
}

return createElement(Camera)

device,
format,
codeScanner: !isPhoto ? codeScanner : undefined,
zoom: zoomValue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要传递 torch 属性给相机组件:torch: flash === 'on' ? 'on' : flash === 'off' ? 'off' : undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants