Commit d23df86b1d0078c05d52acb3fda268c32a72ba89

Authored by 朱显松
1 parent 2c3a12c1

1.修复取消录制视频后,视频仍记录录制问题

2.修复取消录制视频后,重新录制的视频时长缩短问题
config.gradle
... ... @@ -21,7 +21,7 @@ ext {
21 21 //编译方式
22 22 debug : false,
23 23 //版本号
24   - version: "1.0.5.3",
  24 + version: "1.0.6",
25 25 //Lib库前缀
26 26 packeg : "com.cnlive.media",
27 27 //Lib库名称
... ...
lib_media/src/main/java/com/cnlive/media/frame/view/RecordFragmentView.java
... ... @@ -87,12 +87,10 @@ public class RecordFragmentView implements MvpView, PLRecordStateListener {
87 87 // 美颜选项
88 88 // 录制选项
89 89 recordSetting = new PLRecordSetting();
90   -// 最大录制时常
91   - if (getActivity().mOptions != null && getActivity().mOptions.getMaxTime() > 0) {
92   - recordSetting.setMaxRecordDuration(getActivity().mOptions.getMaxTime());
93   - } else {
94   - recordSetting.setMaxRecordDuration(PickerConfig.RECODE_MAX_TIME);
95   - }
  90 + //最大录制时常
  91 + //不限制七牛SDK录制时长,因为删除片段后SDK仍记录已删除片段的时间,重新录制时会导致录制时间缩短或合成失败
  92 + //目前通过计时器进行最大时长限制即可
  93 + recordSetting.setMaxRecordDuration(24 * 60 * 60 * 1000);
96 94  
97 95 recordSetting.setRecordSpeedVariable(true);
98 96 recordSetting.setDisplayMode(PLDisplayMode.FULL);
... ...
lib_media/src/main/java/com/cnlive/media/ui/fragment/RecordFragment.java
... ... @@ -200,7 +200,7 @@ public class RecordFragment extends MvpBindingFragment<RecordFragmentView, Recor
200 200 //视频录制开始
201 201 if (isReady) {
202 202 isRecordIng = true;
203   -// plShortVideoRecorder.deleteLastSection();
  203 + plShortVideoRecorder.deleteAllSections();
204 204 plShortVideoRecorder.beginSection();
205 205 } else {
206 206 isRecordIng = false;
... ... @@ -240,7 +240,7 @@ public class RecordFragment extends MvpBindingFragment<RecordFragmentView, Recor
240 240  
241 241 } else if (state == RecordCameraViewObservable.CLICK_RECODE_ERR) {
242 242 isRecordIng = false;
243   -
  243 + plShortVideoRecorder.endSection();
244 244 }
245 245 }
246 246 }
... ...