LuckSiege / LuckSiege/PictureSelector

设置前置摄像头无效

Open
#2,201 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
13.6k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

com.luck.picture.lib.PictureBaseActivity#startOpenCamera
这个方法中的 config.isCameraAroundState 为true 的时候
只执行 cameraIntent.putExtra(PictureConfig.CAMERA_FACING, PictureConfig.CAMERA_BEFORE);
部分机型还是不能开启前置摄像头
要加入以下两行之后就可以设置为前置摄像头
cameraIntent.putExtra("android.intent.extras.LENS_FACING_FRONT", 1);
cameraIntent.putExtra("android.intent.extra.USE_FRONT_CAMERA", true);

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at com.luck.picture.lib.PictureBaseActivity#startOpenCamera and inspect the config.isCameraAroundState branch where the camera intent is configured. Add the reported front-camera intent extras there, then verify that selecting the front camera works on devices affected by the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.