-
Notifications
You must be signed in to change notification settings - Fork 391
RN下支持camera #2262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+476
−4
Merged
RN下支持camera #2262
Changes from 17 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
b5bfe2c
提交文件
9732d33
开发camera, api-proxy部分还差一部分
c95bff9
补充未提交的文件
ec4eb74
修正上的方法CameraContext的写法
91ed416
合并master后提交
cab0287
修改camera的引入
08e75c9
补充eslint校验
faff0fd
fix camera中navigation是同一个的问题
cf2fbcf
修正逻辑
8ddc173
补充一个页面只有一个camera逻辑
24f61f1
修正flash逻辑,以及显隐逻辑
2737def
更改运行时判断
11ae6cc
修改提示多个camera问题
fef5dae
合并master
d9c3a4a
修正eslint报错
5aa9edf
Merge branch 'master' into feat-camera
5a49bef
在canIuse中补充camera
086d012
删除错误逻辑
c3577b5
修正eslint
1bfa758
补充scancode的type和scanArea
9f672a6
修改flash的开启逻辑
44a69aa
修改传递的torch值
1c441f7
修改分辨率
4a1df2b
补充appshow和apphide的时候camera的active逻辑
6470727
增加page hide&show的监听逻辑控制camera的激活状态
71caebf
补充在扫码模式下不能拍照和视频的逻辑
13aeefb
feat: 修改comments提到的要修改的点
a17b077
Merge branch 'master' into feat-camera
hiyuki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import CreateCamera from './rnCamera' | ||
|
|
||
| function createCameraContext () { | ||
| return new CreateCamera() | ||
| } | ||
|
|
||
| export { | ||
| createCameraContext | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { ENV_OBJ, envError } from '../../../common/js' | ||
|
|
||
| const createCameraContext = ENV_OBJ.createCameraContext || envError('createCameraContext') | ||
|
|
||
| export { | ||
| createCameraContext | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import { noop, getFocusedNavigation } from '@mpxjs/utils' | ||
|
|
||
| export default class CreateCamera { | ||
| constructor () { | ||
| const navigation = getFocusedNavigation() || {} | ||
| this.camera = navigation.camera || {} | ||
| } | ||
|
|
||
| setZoom (options = {}) { | ||
| const { zoom, success = noop, fail = noop, complete = noop } = options | ||
| try { | ||
| if (this.camera.setZoom) { | ||
| const result = { errMsg: 'setZoom:ok' } | ||
| success(result) | ||
| complete(result) | ||
| this.camera.setZoom(zoom) | ||
| } else { | ||
| const result = { | ||
| errMsg: 'setZoom:fail camera instance not found' | ||
| } | ||
| fail(result) | ||
| complete(result) | ||
| } | ||
| } catch (error) { | ||
| const result = { | ||
| errMsg: 'setZoom:fail ' + (error?.message || '') | ||
| } | ||
| fail(result) | ||
| complete(result) | ||
| } | ||
| } | ||
|
|
||
| takePhoto (options) { | ||
| this.camera?.takePhoto(options) | ||
| } | ||
|
|
||
| startRecord (options) { | ||
| this.camera?.startRecord(options) | ||
| } | ||
|
|
||
| stopRecord (options) { | ||
| this.camera?.stopRecord(options) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
类名改为CameraContext