Bladeren bron

Merge branch 'develop' into feature/jeremy

南鑫林 5 jaren geleden
bovenliggende
commit
d925efc3c6
11 gewijzigde bestanden met toevoegingen van 62 en 20 verwijderingen
  1. 14 10
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/ViewController/CommunityVideoListController.swift
  2. 4 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/AlivcShortVideoRoute.h
  3. 6 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/AlivcShortVideoRoute.m
  4. 1 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCrop/Controller/AliyunCropViewController.m
  5. 5 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/Controller/AliyunEditViewController.h
  6. 6 1
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/Controller/AliyunEditViewController.m
  7. 10 4
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoRecord/Controller/AliyunMagicCameraViewController.m
  8. 8 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/Controller/KSMediaPickerController.swift
  9. 2 2
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/Model/KSMediaPickerItemModel.swift
  10. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/View/KSMediaPickerView.swift
  11. 5 2
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicChooseView.swift

+ 14 - 10
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/ViewController/CommunityVideoListController.swift

@@ -31,6 +31,8 @@ class CommunityVideoListController: BaseViewController {
     
     private var prePlayCell: CommunityVideoCoverCollectionCell?
     
+    private var videoListMdl: CommunityVideoListModel?
+    
     deinit {
         if observe != nil {
             NotificationCenter.default.removeObserver(observe!)
@@ -113,9 +115,11 @@ class CommunityVideoListController: BaseViewController {
     override func setupData() {
         self.communityVideoListApi()
         
-        collectionView.addFooterWithWithHeader(withAutomaticallyRefresh: false) {
+        collectionView.addFooterWithWithHeader(withAutomaticallyRefresh: true) {
             [weak self] (page) in
-            self?.communityVideoListApi(page:page)
+            if page <= self?.videoListMdl?.pagination?.totalPages ?? 1 {
+                self?.communityVideoListApi(page:page)
+            }
         }
     }
     
@@ -326,21 +330,21 @@ extension CommunityVideoListController {
     func communityVideoListApi(page:Int = 1) {
         SwiftMoyaNetWorkServiceCommunity.shared().communityVideoListApi(id: contentId ?? 0, page:page) {
             [weak self] (communityVideoListModel) -> (Void) in
-            let videoListMdl = communityVideoListModel as? CommunityVideoListModel
-            self?.videoItemList = videoListMdl?.data
+            self?.videoListMdl = communityVideoListModel as? CommunityVideoListModel
+            self?.videoItemList = self?.videoListMdl?.data
             self?.collectionView.reloadData()
             
-            if videoListMdl?.pagination?.currentPage ?? 1  <= videoListMdl?.pagination?.totalPages ?? 1 {
-                if videoListMdl?.pagination?.currentPage == 1{
+            if self?.videoListMdl?.pagination?.currentPage ?? 1  <= self?.videoListMdl?.pagination?.totalPages ?? 1 {
+                if self?.videoListMdl?.pagination?.currentPage == 1{
                     self?.videoItemList?.removeAll()
                 }
-                self?.videoItemList = (self?.videoItemList)! + (videoListMdl?.data!)!
+                self?.videoItemList = (self?.videoItemList)! + (self?.videoListMdl?.data!)!
                 self?.collectionView.reloadData()
-                if  self?.videoItemList?.count ?? 0 >= videoListMdl?.pagination?.total ?? 0 {
-                    self?.collectionView.isHiddenFooter(true)
+                if  self?.videoListMdl?.pagination?.currentPage ?? 1 >= self?.videoListMdl?.pagination?.totalPages ?? 1 {
+                    self?.collectionView.endFooterNoMoreData()
                 }
             }else {
-                self?.collectionView.isHiddenFooter(true)
+                self?.collectionView.endFooterNoMoreData()
             }
             
         }

+ 4 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/AlivcShortVideoRoute.h

@@ -134,6 +134,10 @@ typedef void (^AlivcCropFinishBlock)(NSString *outputPath);
  */
 - (void)registerEditFinishBlock:(AlivcEditFinishBlock )block;
 
+/**
+ 是否从裁剪Vc进入
+ */
+- (void)registerIsFromCropVc:(BOOL)isFromCropVc;
 
 
 #pragma mark - Crop 裁剪参数输入输出配置

+ 6 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/AlivcShortVideoRoute.m

@@ -22,6 +22,7 @@
 @property (nonatomic, strong)NSString *editInputVideoPath;//编辑传入参数:单个视频的本地路径
 
 @property (nonatomic, assign)BOOL hasRecordMusic;//录制的时候是否带音乐
+@property (nonatomic, assign)BOOL isFromCropVc;//是否从裁剪进入
 
 @property (nonatomic, strong)NSString *editInputMediasPath;//编辑传入参数:多个媒体资源的本地存放文件夹路径
 
@@ -106,6 +107,7 @@ static AlivcShortVideoRoute *_instance = nil;
             }
             
             [controller setValue:@(self.hasRecordMusic) forKey:@"hasRecordMusic"];
+            [controller setValue:@(self.isFromCropVc) forKey:@"isFromCropVc"];
             
         }
             break;
@@ -211,6 +213,10 @@ static AlivcShortVideoRoute *_instance = nil;
     _hasRecordMusic = hasRecordMusic;
 }
 
+- (void)registerIsFromCropVc:(BOOL)isFromCropVc {
+    _isFromCropVc = isFromCropVc;
+}
+
 #pragma mark - other
 
 @end

+ 1 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCrop/Controller/AliyunCropViewController.m

@@ -413,6 +413,7 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
     [[AlivcShortVideoRoute shared] registerEditVideoPath:nil];
     [[AlivcShortVideoRoute shared] registerEditMediasPath:taskPath];
     [[AlivcShortVideoRoute shared] registerMediaConfig:_cutInfo];
+    [[AlivcShortVideoRoute shared] registerIsFromCropVc:YES];
     UIViewController *editVC = [[AlivcShortVideoRoute shared] alivcViewControllerWithType:AlivcViewControlEdit];
     dispatch_async(dispatch_get_main_queue(), ^{
         [self.navigationController pushViewController:editVC animated:YES];

+ 5 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/Controller/AliyunEditViewController.h

@@ -43,5 +43,10 @@
  */
 @property (nonatomic, assign) BOOL hasRecordMusic;
 
+/**
+ 是否从裁剪Vc进入
+ */
+@property (nonatomic, assign) BOOL isFromCropVc;
+
 
 @end

+ 6 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/Controller/AliyunEditViewController.m

@@ -570,7 +570,12 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
     [self.player stop];
     
     _config.outputSize = _inputOutputSize;
-    [self.navigationController popViewControllerAnimated:YES];
+    
+    if (_isFromCropVc) {
+        [self.navigationController popToRootViewControllerAnimated:YES];
+    } else {
+        [self.navigationController popViewControllerAnimated:YES];
+    }
 }
 
 /**

+ 10 - 4
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoRecord/Controller/AliyunMagicCameraViewController.m

@@ -520,6 +520,7 @@
     [self starPreview];
     
     _magicCameraView.hide = NO;
+    _magicCameraView.backButton.hidden = NO;
     [_magicCameraView resetRecordButtonUI];
     _magicCameraView.recording = NO;
     _magicCameraView.realVideoCount = [_clipManager partCount];
@@ -768,6 +769,7 @@
 - (void)recordButtonRecordVideo{
     if (self.magicCameraView.backButton.enabled == NO) {
         _magicCameraView.hide = NO;
+        _magicCameraView.backButton.hidden = NO;
         self.magicCameraView.progressView.videoCount--;
         [self.magicCameraView resetRecordButtonUI];
         self.magicCameraView.recording = NO;
@@ -775,7 +777,7 @@
         return;
     }
     
-    NSLog(@"---------->点击了录制按钮");
+    // 点击了录制按钮
     if (self.hideSegmentBlock) {
         self.hideSegmentBlock(true);
     }
@@ -793,11 +795,11 @@
     int code =  [_recorder startRecording];
     if (code == 0) {
         _magicCameraView.hide = YES;
-        _magicCameraView.backButton.enabled = NO;
+        _magicCameraView.backButton.hidden = YES;
     }else{
         NSLog(@"---------->startRecording错误error:  code:%d",code);
         _magicCameraView.hide = NO;
-        _magicCameraView.backButton.enabled = YES;
+        _magicCameraView.backButton.hidden = NO;
         self.magicCameraView.progressView.videoCount--;
         [self.magicCameraView resetRecordButtonUI];
         self.magicCameraView.recording = NO;
@@ -806,11 +808,12 @@
 }
 
 - (void)recordButtonPauseVideo {
-    NSLog(@"---------->点击了暂停录制按钮");
+    // 点击了暂停录制按钮
     [_recorder stopRecording];
     _magicCameraView.userInteractionEnabled =NO;
     self.upTime = CFAbsoluteTimeGetCurrent();
     _magicCameraView.hide = NO;
+    _magicCameraView.backButton.hidden = NO;
 }
 
 - (void)recordButtonFinishVideo {
@@ -818,6 +821,7 @@
     _quVideo.videoRotate = [_clipManager firstClipVideoRotation];
     [_recorder finishRecording];
     _magicCameraView.hide = NO;
+    _magicCameraView.backButton.hidden = NO;
 }
 
 - (void)backButtonClicked {
@@ -1072,6 +1076,7 @@
         }else{
             [[AlivcShortVideoRoute shared]registerEditVideoPath:outputPath];
             [[AlivcShortVideoRoute shared]registerEditMediasPath:nil];
+            [[AlivcShortVideoRoute shared] registerIsFromCropVc:NO];
             if(self.curMusicUrl && ![self.curMusicUrl isEqualToString:@""]){
                 [[AlivcShortVideoRoute shared] registerHasRecordMusic:YES];
             }else{
@@ -1100,6 +1105,7 @@
     [MBProgressHUD hideHUDForView:self.view animated:YES];
     self.magicCameraView.backButton.enabled = YES;
     _magicCameraView.hide = NO;
+    _magicCameraView.backButton.hidden = NO;
     [_magicCameraView resetRecordButtonUI];
     _magicCameraView.recording = NO;
     _magicCameraView.realVideoCount = [_clipManager partCount];

+ 8 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/Controller/KSMediaPickerController.swift

@@ -408,6 +408,14 @@ open class KSMediaPickerController: UIViewController, UICollectionViewDelegate,
             }
             cell.isMultipleSelected = maxItemCount > 1
         }
+        
+        // 3.0s以下视频不可选择
+        if mediaType == .video {
+            let duration = Double(itemModel?.asset.duration ?? 0)
+            if duration < 3.0 {
+                itemModel?.isLoseFocus = true
+            }
+        }
         cell.itemModel = itemModel
         return cell
     }

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/Model/KSMediaPickerItemModel.swift

@@ -45,8 +45,8 @@ open class KSMediaPickerItemModel: NSObject {
     open var zoomScale: CGFloat?
     open var contentSize: CGSize?
     open var imageFrame: CGRect?
-    open var isHighlight = false
-    open var isLoseFocus = false
+    open var isHighlight = false    // 是否被聚焦显示
+    open var isLoseFocus = false    // 是否被选中
     @objc open var index = UInt(0) {
         didSet {
             if index == 0 {

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/View/KSMediaPickerView.swift

@@ -159,7 +159,7 @@ open class KSMediaPickerView: UIView {
             _panBeginLocationY = pan.location(in: self).y
             break
         case .changed:
-            // preview视图收起展示逻辑
+            // FIXME: preview视图收起展示逻辑
 //            guard let baseY = _baseY else {
 //                return
 //            }

+ 5 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicChooseView.swift

@@ -187,7 +187,8 @@ class PublishMusicChooseView: FWPopupView {
     //MARK: -
     //1.初始化JXSegmentedView
     lazy var segmentedView: JXSegmentedView = {
-        let segmentedView = JXSegmentedView(frame: CGRect(x: 0, y: 48, width: kScreenWidth, height: 44))
+//        let segmentedView = JXSegmentedView(frame: CGRect(x: 0, y: 48, width: kScreenWidth, height: 44))
+        let segmentedView = JXSegmentedView(frame: CGRect(x: 0, y: 48, width: kScreenWidth, height: 44+100))
         segmentedView.delegate = self
         segmentedView.dataSource = segmentedDataSource
         segmentedView.indicators = [indicator]
@@ -235,7 +236,9 @@ class PublishMusicChooseView: FWPopupView {
         let listContainerView = JXSegmentedListContainerView(dataSource: self)
         listContainerView.didAppearPercent = 0.01
         listContainerView.defaultSelectedIndex = 0
-        listContainerView.frame = CGRect(x: 0, y: 48+44, width: kScreenWidth, height: kScreenHeight - kSafeTabBarHeight - kSafeStatusBarHeight - 103 - 114)
+//        listContainerView.frame = CGRect(x: 0, y: 48+44, width: kScreenWidth, height: kScreenHeight - kSafeTabBarHeight - kSafeStatusBarHeight - 103 - 114)
+        
+        listContainerView.frame = CGRect(x: 0, y: 48+44+100, width: kScreenWidth, height: kScreenHeight - kSafeTabBarHeight - kSafeStatusBarHeight - 103 - 114-100)
         return listContainerView
     }()