Browse Source

Merge branch 'master' of https://git.yishihui.com/iOS/Introduce

wenweiwei 3 years ago
parent
commit
6ed32790e6

+ 17 - 2
Introduce/Record/INPhotoVideosController.swift

@@ -171,7 +171,7 @@ class INPhotoVideosController: BFBaseViewController {
         nextBtn.setTitle("下一步", for: .normal)
         nextBtn.titleLabel?.font = UIFont.systemFont(ofSize: 12)
         nextBtn.layer.cornerRadius = 4
-        nextBtn.addTarget(self, action: #selector(rightBtnClick(sender:)), for: .touchUpInside)
+        nextBtn.addTarget(self, action: #selector(nextBtnClick(sender:)), for: .touchUpInside)
         bottomV.addSubview(nextBtn)
     }
 
@@ -226,8 +226,23 @@ class INPhotoVideosController: BFBaseViewController {
         }
     }
 
-    override func rightBtnClick(sender _: UIButton) {
+    @objc func nextBtnClick(sender _: UIButton) {
         if let assets = chosedAsset, assets.count > 0 {
+            if let totalDura = chosedAsset?.reduce(0.0, { partialResult, phasset in
+                let dur = (phasset.mediaType == .video) ?  phasset.duration : 0
+                return (partialResult ?? 0.0) + dur
+            }), totalDura > 7200{
+                let alertController = UIAlertController(title: nil, message: "素材总时长不能超过2小时", preferredStyle: UIAlertController.Style.alert)
+                let cancelAction = UIAlertAction(title: "确定", style: .default, handler: nil)
+                alertController.addAction(cancelAction)
+                self.present(alertController, animated: true, completion: nil)
+                return
+            }
+//           判断是否时icloud网络资源
+//            let arr = assets.filter { asset in
+//                asset.
+//            }
+//
             let vc = INIntroduceController()
             vc.assets = assets
             navigationController?.pushViewController(vc, animated: true)

+ 1 - 1
Introduce/Record/INRecorderController.swift

@@ -74,7 +74,7 @@ class INRecorderController: BFBaseViewController {
 
         protocolLab.appendLink(withText: "  《用户隐私政策》", linkFont: UIFont.systemFont(ofSize: 14), linkColor: UIColor.hexColor(hexadecimal: "#90a9d2"), underLineStyle:CTUnderlineStyle(), linkData: cPrivacy)
         
-        protocolLab.appendLink(withText: "\n\n", linkFont: UIFont.systemFont(ofSize: 14), linkColor: UIColor.hexColor(hexadecimal: "#999999"), underLineStyle: CTUnderlineStyle(), linkData: nil)
+        protocolLab.appendLink(withText: ",以了解用户权利义务和个人信息处理规则。\n\n", linkFont: UIFont.systemFont(ofSize: 14), linkColor: UIColor.hexColor(hexadecimal: "#434343"), underLineStyle: CTUnderlineStyle(), linkData: nil)
         
         protocolLab.appendLink(withText: "点击同意表示您已阅读并且认可所有条款。", linkFont: UIFont.systemFont(ofSize: 14), linkColor: UIColor(red: 0.262, green: 0.262, blue: 0.262, alpha: 1), underLineStyle: CTUnderlineStyle(), linkData: nil)
         protocolLab.textAlignment = CTTextAlignment.left

+ 4 - 0
Introduce/Record/INVideoExportController.swift

@@ -452,6 +452,10 @@ class INVideoExportController: BFBaseViewController {
                 let cmtime = CMTime(value: CMTimeValue(Float64(sender.value) * Float64(self?.avplayer.currentItem?.asset.duration.seconds ?? 0) * 1000.0), timescale: CMTimeScale(1000.0))
                 BFLog(message: "cmtime == \(cmtime),\(cmtime.seconds)")
                 self?.avplayer.seek(to: cmtime, toleranceBefore: CMTime(seconds: 1, preferredTimescale: 1000), toleranceAfter: CMTime(seconds: 1, preferredTimescale: 1000))
+                self?.avplayer.play()
+            }
+            sliderView?.slideBeginDrag = { [weak self] in
+                self?.avplayer.pause()
             }
             sliderView?.btnClickBloc = { [weak self] sender in
                 // 按钮点击