Commit 0b007bc40e911b3ebb99213943a945bd6c87b064
1 parent
ecf81cbe
前置摄像头关闭闪光灯
Showing
3 changed files
with
6 additions
and
8 deletions
config.gradle
lib_media/src/main/java/com/cnlive/media/frame/view/RecordFragmentView.java
| ... | ... | @@ -10,11 +10,8 @@ import android.view.MotionEvent; |
| 10 | 10 | import android.view.View; |
| 11 | 11 | import android.view.animation.OvershootInterpolator; |
| 12 | 12 | |
| 13 | -import androidx.activity.OnBackPressedCallback; | |
| 14 | - | |
| 15 | 13 | import com.cnlive.libs.base.util.AlertUtil; |
| 16 | 14 | import com.cnlive.media.PickerConfig; |
| 17 | -import com.cnlive.media.ui.activity.MediaActivity; | |
| 18 | 15 | import com.cnlive.media.ui.activity.RecordActivity; |
| 19 | 16 | import com.cnlive.media.ui.fragment.RecordFragment; |
| 20 | 17 | import com.cnlive.media.utils.AndroidQUtil; |
| ... | ... | @@ -71,9 +68,9 @@ public class RecordFragmentView implements MvpView, PLRecordStateListener { |
| 71 | 68 | if (cameraSetting == null) |
| 72 | 69 | cameraSetting = new PLCameraSetting(); |
| 73 | 70 | //设置摄像头 |
| 74 | - if (SamsungCamaerUtil.isSamsungAndOpenFont(mFragment.getActivity())){ | |
| 71 | + if (SamsungCamaerUtil.isSamsungAndOpenFont(mFragment.getActivity())) { | |
| 75 | 72 | cameraSetting.setCameraId(PLCameraSetting.CAMERA_FACING_ID.CAMERA_FACING_FRONT); |
| 76 | - }else { | |
| 73 | + } else { | |
| 77 | 74 | cameraSetting.setCameraId(chooseCameraFacingId()); |
| 78 | 75 | } |
| 79 | 76 | |
| ... | ... | @@ -163,6 +160,7 @@ public class RecordFragmentView implements MvpView, PLRecordStateListener { |
| 163 | 160 | } else if (PLCameraSetting.hasCameraFacing(PLCameraSetting.CAMERA_FACING_ID.CAMERA_FACING_BACK)) { |
| 164 | 161 | return PLCameraSetting.CAMERA_FACING_ID.CAMERA_FACING_BACK; |
| 165 | 162 | } else { |
| 163 | + processFlash(false); | |
| 166 | 164 | return PLCameraSetting.CAMERA_FACING_ID.CAMERA_FACING_FRONT; |
| 167 | 165 | } |
| 168 | 166 | } | ... | ... |
lib_media/src/main/java/com/cnlive/media/ui/fragment/RecordFragment.java
| ... | ... | @@ -17,7 +17,6 @@ import androidx.core.app.ActivityCompat; |
| 17 | 17 | import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; |
| 18 | 18 | import com.cnlive.libs.base.util.DoublePressed; |
| 19 | 19 | import com.cnlive.libs.util.Config; |
| 20 | -import com.cnlive.media.PickerConfig; | |
| 21 | 20 | import com.cnlive.media.R; |
| 22 | 21 | import com.cnlive.media.databinding.FragmentRecordBinding; |
| 23 | 22 | import com.cnlive.media.frame.presenter.RecordFragmentPresenter; |
| ... | ... | @@ -134,7 +133,7 @@ public class RecordFragment extends MvpBindingFragment<RecordFragmentView, Recor |
| 134 | 133 | if (plShortVideoRecorder != null) { |
| 135 | 134 | binding.rcControl.resetRecord(); |
| 136 | 135 | plShortVideoRecorder.pause(); |
| 137 | - isFlash=false; | |
| 136 | + isFlash = false; | |
| 138 | 137 | getMvpView().processFlash(isFlash); |
| 139 | 138 | } |
| 140 | 139 | } |
| ... | ... | @@ -180,6 +179,7 @@ public class RecordFragment extends MvpBindingFragment<RecordFragmentView, Recor |
| 180 | 179 | } else { |
| 181 | 180 | if (DoublePressed.onDoublePressed()) return; |
| 182 | 181 | plShortVideoRecorder.switchCamera(); |
| 182 | + getMvpView().processFlash(false); | |
| 183 | 183 | } |
| 184 | 184 | } else if (state == RecordCameraViewObservable.CLICK_FINISH) { |
| 185 | 185 | requireActivity().getOnBackPressedDispatcher().onBackPressed(); | ... | ... |