Selaa lähdekoodia

Merge branch 'master' of https://git.yishihui.com/iOS/BFFramework
合并代码

jsonwang 3 vuotta sitten
vanhempi
commit
36f11af06a

+ 6 - 3
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointPublicController.swift

@@ -498,7 +498,7 @@ class PQStuckPointPublicController: PQBaseViewController {
             make.right.equalTo(view.snp_centerX).offset(-cDefaultMargin)
             make.width.equalTo(164)
             make.height.equalTo(52)
-            make.bottom.equalTo(finishedBtn.snp_top).offset(-34)
+            make.bottom.equalTo(finishedBtn.snp_top).offset(-32)
         }
         shareFriendBtn.snp.makeConstraints { make in
             make.left.equalTo(view.snp_centerX).offset(cDefaultMargin)
@@ -536,7 +536,10 @@ class PQStuckPointPublicController: PQBaseViewController {
         
         remindLab.snp.makeConstraints { make in
             make.centerX.equalToSuperview()
-            make.bottom.equalTo(inputBackView.snp_top).offset(-16)
+            make.bottom.equalTo(inputBackView.snp_top).offset(-16).priorityHigh()
+            make.height.equalTo(44)
+            make.top.greaterThanOrEqualTo(5)
+            make.bottom.lessThanOrEqualTo(inputBackView.snp_top).offset(-5)
         }
  
         titleLabel.snp.makeConstraints { make in
@@ -1030,7 +1033,7 @@ extension PQStuckPointPublicController {
                     reCreateVideo.reProduceVideoFlag = 1
                     self?.videoData?.reCreateVideoData = reCreateVideo
                 }
-                postNotification(name: cPublishStuckPointSuccessKey, userInfo: ["newVideoData": self?.videoData!])
+                postNotification(name: cPublishStuckPointSuccessKey, userInfo: ["newVideoData": self?.videoData ?? PQVideoListModel()])
                 BFLog(message: "发布成功==\(videoData.title ?? ""),uplpadBucketKey = \(videoData.uplpadBucketKey ?? "")")
 //                                cShowHUB(superView: nil, msg: "视频发布成功")
                 // 发布成功后续操作

+ 19 - 16
BFFramework/Classes/Stuckpoint/ViewModel/PQGPUImagePlayerView.swift

@@ -108,7 +108,7 @@ public class PQGPUImagePlayerView: UIView {
     /// Add filters to this array and call updateAsset(_:) method
     public var filters: [ImageProcessingOperation] = []
 
-   public var movie: PQMovieInput?
+    public var movie: PQMovieInput?
 
     public var speaker: SpeakerOutput?
 
@@ -290,7 +290,7 @@ public class PQGPUImagePlayerView: UIView {
     }
 
     // 设置画布比例
-   public func resetCanvasFrame(frame: CGRect) {
+    public func resetCanvasFrame(frame: CGRect) {
         if self.frame.equalTo(frame) {
             FilterLog(message: "新老值一样,不重置")
             return
@@ -311,7 +311,11 @@ public class PQGPUImagePlayerView: UIView {
         playMaskView.frame = CGRect.init(x: 0, y: 0, width: self.frame.width, height: self.frame.height)
         tipLab.frame = CGRect(x: (self.frame.size.width - 100) / 2, y: (self.frame.size.height - 14) / 2, width: 100, height: 14)
         progressLab.frame = CGRect(x: (self.frame.size.width - 140) / 2, y: 8, width: 140, height: 14)
-        playView.frame = CGRect(x: (self.frame.size.width - self.frame.size.height / 3.6) / 2, y: (self.frame.size.height - self.frame.size.height / 3.6) / 2, width: self.frame.size.height / 3.6, height: self.frame.size.height / 3.6)
+
+        let bord = frame.size.width > frame.size.height ? CGFloat(64) : CGFloat(100)
+        playView.frame = CGRect(x: (CGFloat(frame.size.width) - bord) / 2 , y: (CGFloat(frame.size.height) - bord) / 2, width: bord, height: bord)
+    
+//        playView.frame = CGRect(x: (self.frame.size.width - self.frame.size.height / 3.6) / 2, y: (self.frame.size.height - self.frame.size.height / 3.6) / 2, width: self.frame.size.height / 3.6, height: self.frame.size.height / 3.6)
     }
 
     override public func layoutSubviews() {
@@ -402,29 +406,28 @@ public class PQGPUImagePlayerView: UIView {
             }
         }
         guard let movie = movie else { return }
-        movie.progress = { [weak self, movie] currTime, duration, prgressValue in
+        movie.progress = { [weak self] currTime, duration, prgressValue in
             guard let strongSelf = self else { return }
 
-            FilterLog(message: " movie.currentTime.seconds 进度\(movie.currentTime.seconds)")
-            self?.changeFilter(currTime: movie.currentTime.seconds)
-            
-            self?.progress?(currTime, duration, prgressValue)
+//            HHZPrint(" movie 进度\(currTime)")
+            strongSelf.changeFilter(currTime: currTime)
+            strongSelf.progress?(currTime, duration, prgressValue)
 
             DispatchQueue.main.async {
-                strongSelf.playbackTime = movie.currentTime.seconds
+                strongSelf.playbackTime = currTime
 
                 // Non-main thread change this property is not valid
                 strongSelf.animationLayer?.timeOffset = strongSelf.playbackTime
                 if strongSelf.showProgressLab {
-                    
+
                     if(strongSelf.showProgressStartTime == 0 ){
-                        strongSelf.showProgressStartTime = Float(CMTimeGetSeconds(movie.startTime ?? .zero))
+                        strongSelf.showProgressStartTime = Float(CMTimeGetSeconds(strongSelf.movie?.startTime ?? .zero))
                     }
                     if duration < 1 {
-                       
-                        strongSelf.progressLab.text =  "\((currTime - Double(CMTimeGetSeconds(movie.startTime ?? .zero))).formatDurationToHMS()) / 00:01"
+
+                        strongSelf.progressLab.text =  "\((currTime - Double(CMTimeGetSeconds(strongSelf.movie?.startTime ?? .zero))).formatDurationToHMS()) / 00:01"
                     } else {
-                        
+
                         var showTime = currTime -  Double(strongSelf.showProgressStartTime)
                         if (showTime < 0){
                             showTime = 0
@@ -462,7 +465,7 @@ public class PQGPUImagePlayerView: UIView {
         if mStickers?.count ?? 0 > 0 {
             
             for (index , sticker) in mStickers!.enumerated() {
-                print( "mStickers timelinein:\(sticker.timelineIn) timelineout: \(sticker.timelineOut) index : \(index)")
+                BFLog(message: "mStickers timelinein:\(sticker.timelineIn) timelineout: \(sticker.timelineOut) index : \(index)")
 
             }
             
@@ -483,7 +486,7 @@ public class PQGPUImagePlayerView: UIView {
                     showFitler = PQImageFilter(sticker: currentSticker)
                 }
                 if showFitler != nil {
-                    print( " 加入到缓存 的 filter timelinein:\(currentSticker.timelineIn) timelineout: \(currentSticker.timelineOut) in :\(currentSticker.model_in) out: \(currentSticker.out) index : \(index)")
+                    BFLog(message: " 加入到缓存 的 filter timelinein:\(currentSticker.timelineIn) timelineout: \(currentSticker.timelineOut) in :\(currentSticker.model_in) out: \(currentSticker.out) index : \(index)")
                     cacheFilters.append(showFitler!)
                 }