|
@@ -2,6 +2,7 @@ package com.cooleshow.student.ui.web;
|
|
|
|
|
|
import static com.cooleshow.base.common.WebConstants.WEB_URL;
|
|
import static com.cooleshow.base.common.WebConstants.WEB_URL;
|
|
|
|
|
|
|
|
+import android.annotation.SuppressLint;
|
|
import android.app.Activity;
|
|
import android.app.Activity;
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
import android.content.pm.ActivityInfo;
|
|
import android.content.pm.ActivityInfo;
|
|
@@ -213,12 +214,7 @@ public class AccompanyActivity extends BaseMVPActivity<ActivityAccompanyBinding,
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public void startCapture() {
|
|
public void startCapture() {
|
|
- if (cameraView != null) {
|
|
|
|
- recordVideFilePath = MyFileUtils.getPublicDirectory(videoDerectoryName) + File.separator
|
|
|
|
- + "VID_" + new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.CHINA).format(new Date()) + ".mp4";
|
|
|
|
- cameraView.captureVideo(new File(recordVideFilePath));//开始录像
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ toStartCapture();
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -327,6 +323,27 @@ public class AccompanyActivity extends BaseMVPActivity<ActivityAccompanyBinding,
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @SuppressLint("CheckResult")
|
|
|
|
+ private void toStartCapture() {
|
|
|
|
+ Observable.create(new ObservableOnSubscribe<Object>() {
|
|
|
|
+ @Override
|
|
|
|
+ public void subscribe(@NonNull ObservableEmitter<Object> emitter) {
|
|
|
|
+ if (cameraView != null) {
|
|
|
|
+ recordVideFilePath = MyFileUtils.getPublicDirectory(videoDerectoryName) + File.separator
|
|
|
|
+ + "VID_" + new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.CHINA).format(new Date()) + ".mp4";
|
|
|
|
+ cameraView.captureVideo(new File(recordVideFilePath));//开始录像
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }).subscribeOn(Schedulers.io())
|
|
|
|
+ .observeOn(Schedulers.io())
|
|
|
|
+ .subscribe(new Consumer<Object>() {
|
|
|
|
+ @Override
|
|
|
|
+ public void accept(Object o) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
private void handleFileResult(String filePath) {
|
|
private void handleFileResult(String filePath) {
|
|
hideLoading();
|
|
hideLoading();
|
|
saveVideoToGallery(filePath);
|
|
saveVideoToGallery(filePath);
|