소스 검색

视频时长限制

Steven 8 달 전
부모
커밋
3a7373a0b4
2개의 변경된 파일112개의 추가작업 그리고 120개의 파일을 삭제
  1. 12 2
      KulexiuForTeacher/KulexiuForTeacher/Common/Tools/Custom/KSMediaManager.m
  2. 100 118
      KulexiuForTeacher/Pods/Pods.xcodeproj/project.pbxproj

+ 12 - 2
KulexiuForTeacher/KulexiuForTeacher/Common/Tools/Custom/KSMediaManager.m

@@ -174,9 +174,19 @@
     [self extracted:imagePickerVc];
     
     [imagePickerVc setDidFinishPickingVideoHandle:^(UIImage *coverImage, PHAsset *asset) {
-        if (asset.duration >= 481) {
+        NSInteger maxDuration = self.videoMaxDuration == 0 ? 480 : self.videoMaxDuration;
+        if (asset.duration >= maxDuration + 1) {
+            NSString *tipsMessage = @"";
+            // 如果不是整分钟,提示秒 如果是整数分钟,提示分钟
+            if (maxDuration % 60 == 0) {
+                NSInteger minuteNum = maxDuration / 60;
+                tipsMessage = [NSString stringWithFormat:@"视频长度不能超过%zd分钟", minuteNum];
+            }
+            else {
+                tipsMessage = [NSString stringWithFormat:@"视频长度不能超过%zd秒",self.videoMaxDuration];
+            }
             dispatch_main_async_safe(^{
-                [LOADING_MANAGER MBShowAUTOHidingInWindow:@"视频长度不能超过8分钟"];
+                [LOADING_MANAGER MBShowAUTOHidingInWindow:tipsMessage];
             });
             return;
         }

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 100 - 118
KulexiuForTeacher/Pods/Pods.xcodeproj/project.pbxproj


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.