Ver código fonte

Merge branch 'dev'

# Conflicts:
#	Introduce.xcodeproj/project.pbxproj
#	Podfile
jsonwang 3 anos atrás
pai
commit
1369e058fb

+ 4 - 4
Introduce.xcodeproj/project.pbxproj

@@ -483,7 +483,7 @@
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 19;
+				CURRENT_PROJECT_VERSION = 20;
 				DEVELOPMENT_TEAM = UH52C8A7SN;
 				ENABLE_BITCODE = NO;
 				EXCLUDED_ARCHS = "";
@@ -507,7 +507,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 1.1.1;
+				MARKETING_VERSION = 1.2.0;
 				PRODUCT_BUNDLE_IDENTIFIER = com.piaoquan.introduce;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
@@ -530,7 +530,7 @@
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 19;
+				CURRENT_PROJECT_VERSION = 20;
 				DEVELOPMENT_TEAM = UH52C8A7SN;
 				ENABLE_BITCODE = NO;
 				EXCLUDED_ARCHS = "";
@@ -554,7 +554,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 1.1.1;
+				MARKETING_VERSION = 1.2.0;
 				PRODUCT_BUNDLE_IDENTIFIER = com.piaoquan.introduce;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";

+ 0 - 1
Introduce/Aarchitecture/AppDelegate.swift

@@ -93,6 +93,5 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
                 print("用户关闭了广告追踪IDFA")
             }
         }
-
     }
 }

+ 21 - 0
Introduce/Assets.xcassets/home/addwx.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "addwx@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Introduce/Assets.xcassets/home/addwx.imageset/addwx@3x.png


+ 5 - 0
Introduce/Info.plist

@@ -2,6 +2,11 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
+	<key>NSAppTransportSecurity</key>
+	<dict>
+		<key>NSAllowsArbitraryLoads</key>
+		<true/>
+	</dict>
 	<key>NSBonjourServices</key>
 	<array>
 		<string>_adhp._tcp</string>

+ 1 - 1
Introduce/PQConfig.plist

@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
 	<key>ENVMode</key>
-	<string>ENVModeTest</string>
+	<string>ENVModeOnline</string>
 	<key>ENChannel</key>
 	<string>Appstore</string>
 	<key>ENBuildTime</key>

+ 19 - 1
Introduce/Record/INIntroduceController.swift

@@ -26,6 +26,8 @@ class INIntroduceController: BFBaseViewController {
     let exportBtn = UIButton()
     var assets: [PHAsset]?
 
+    let recordUid = getRandomStringOfLength(length: 16)
+
     let recordScreenVC = BFRecordScreenController()
     
     lazy var addMaterialBtn : UIButton  = {
@@ -101,6 +103,14 @@ class INIntroduceController: BFBaseViewController {
             BFEventTrackAdaptor.baseReportUpload(businessType: .bt_buttonClick, objectType: .ot_captionsButton, pageSource: .sp_speekPage,extParams: ["isSubtitlesClose":isOn],commonParams: commonParams())
         }
         
+        recordScreenVC.voiceBtnClickHandle = { voice in
+            if(voice != nil){
+                BFEventTrackAdaptor.baseReportUpload(businessType: .bt_buttonClick, objectType: .ot_voiceChangerButton, pageSource: .sp_speekPage,extParams: ["voiceMode":voice?.voice ?? ""],commonParams: commonParams())
+            }
+            
+        }
+        
+        
         navHeadImageView?.addSubview(stripSwithView)
         navHeadImageView?.addSubview(addMaterialBtn)
         stripSwithView.snp.makeConstraints { make in
@@ -272,6 +282,13 @@ class INIntroduceController: BFBaseViewController {
     }
 
     @objc func exportAction() {
+        
+        recordScreenVC.isExportAction = true
+        //add by ak 如果当前段有没有转完的发音人显示 Loadingview
+        if(!recordScreenVC.voiceChangeStickerFinish(isShowLoadView: true)){
+            return
+        }
+        
         let count = recordScreenVC.itemModels.reduce(0, { partialResult, model in
             model.voiceStickers.count + partialResult
         })
@@ -280,12 +297,13 @@ class INIntroduceController: BFBaseViewController {
             return
         }
         
-        recordScreenVC.backBtnClick()
+        recordScreenVC.pause()
 
         let controller = INVideoExportController()
         controller.export.data = recordScreenVC.itemModels
         controller.export.originSoundVolumn = recordScreenVC.noSpeakVolume
         controller.export.originSoundInRecordVolumn = recordScreenVC.haveSpeakVolume
+        controller.recordUid = recordUid
         controller.coverIV.image = recordScreenVC.itemModels.first?.coverImg
         navigationController?.pushViewController(controller, animated: true)
         // 点击导出按钮上报

+ 32 - 4
Introduce/Record/INRecorderController.swift

@@ -155,6 +155,14 @@ class INRecorderController: BFBaseViewController {
         return btn
     }()
     
+    lazy var addwxBtn: UIButton = {
+        let btn = UIButton(type: .custom)
+        btn.setImage(UIImage(named: "addwx"), for: .normal)
+        btn.addTarget(self, action: #selector(addwxAction), for: .touchUpInside)
+
+        return btn
+    }()
+    
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         hiddenNavigation()
@@ -180,21 +188,29 @@ class INRecorderController: BFBaseViewController {
         if(PQENVUtil.shared.channel == "Development"){
             view.addSubview(buildTimeLabel)
         }
-      
- 
+
         view.addSubview(centerView)
+        view.addSubview(addwxBtn)
         view.addSubview(settingBtn)
+        
         centerView.snp.makeConstraints { make in
             make.width.equalToSuperview()
             make.height.equalTo(209)
             make.center.equalToSuperview()
         }
+        addwxBtn.snp.makeConstraints { make in
+            make.height.equalTo(40)
+            make.width.equalTo(119)
+            make.right.equalTo(-10)
+            make.top.equalTo(51)
+        }
         settingBtn.snp.makeConstraints { make in
             make.width.height.equalTo(40)
-            make.right.equalToSuperview().offset(-10)
-            make.top.equalToSuperview().offset(51)
+            make.left.equalTo(10)
+            make.top.equalTo(51)
         }
 
+
         
         centerView.addSubview(titleL)
         centerView.addSubview(camaraBtn)
@@ -331,6 +347,18 @@ class INRecorderController: BFBaseViewController {
         navigationController?.pushViewController(vc, animated: true)
     }
     
+    @objc func addwxAction(){
+        let alertv = UIAlertController(title: "添加微信好友", message: "\n遇到问题?功能建议?真诚期待和你聊天,请加微信 cjz_0216", preferredStyle: .alert)
+        let sureAction = UIAlertAction(title: "复制微信号", style: .default, handler: { action in
+            UIPasteboard.general.string = "cjz_0216"
+            cShowHUB(superView: nil, msg: "已复制到剪切板")
+        })
+        sureAction.setValue(UIColor.hexColor(hexadecimal:"0x389AFF"), forKey: "_titleTextColor")
+        alertv.addAction(sureAction)
+
+        self.present(alertv, animated: true, completion: nil)
+        
+    }
     
     func chechCameraPromission() -> Bool{
         if  AVCaptureDevice.authorizationStatus(for: AVMediaType.video) != AVAuthorizationStatus.denied {

+ 58 - 1
Introduce/Record/INVideoExportController.swift

@@ -13,9 +13,18 @@ import Foundation
 import Photos
 import SwiftUI
 import UIKit
+import BFUploadKit
+import AliyunOSSiOS
 
 class INVideoExportController: BFBaseViewController {
+    let uploadData = PQUploadModel()
+    
+    var hadUploadTask = true  // 本期不上传
+    
     var avplayerTimeObserver: NSKeyValueObservation?
+    
+    var recordUid = getRandomStringOfLength(length: 16)
+
     let backV : UIView = {
         let v = UIView()
         v.backgroundColor = UIColor.hexColor(hexadecimal: "#1A1A1A")
@@ -264,7 +273,13 @@ class INVideoExportController: BFBaseViewController {
                     wself.playDurL.isHidden = false
                     wself.sliderView?.playStart()
                     wself.completeBtn.isHidden = false
-
+                    
+                    if !wself.hadUploadTask{
+                        wself.uploadData.localPath = fileUrl.absoluteString
+                        wself.hadUploadTask = true
+                        wself.uploadVideo()
+                    }
+                    
                     let item = AVPlayerItem(url: fileUrl)
                     wself.avplayer.replaceCurrentItem(with: item)
                     usleep(1000)
@@ -401,6 +416,8 @@ class INVideoExportController: BFBaseViewController {
         view.backgroundColor = .black
         navHeadImageView?.backgroundColor = .clear
 
+//        uploadData.videoBucketKey = recordUid
+        
         leftButton(image: nil, imageName: nil, tintColor: UIColor.white)
 
         addSubviews()
@@ -860,6 +877,46 @@ class INVideoExportController: BFBaseViewController {
 //        }
 //        UIApplication.shared.keyWindow?.addSubview(alertV)
     }
+    
+    //MARK: - Request
+    
+    func uploadVideo() {
+        // 文件上传OSS需要登录用户校验,视说APP使用一个固定用户上传。测试环境用户token: a065b8aa42481a8ae81ccc60dbc82d490c5dcefa
+        // 生产环境用户token: f9a4ddb9f8abecdfdc246b341f1523d51af59096
+        BFConfig.shared.token = "a065b8aa42481a8ae81ccc60dbc82d490c5dcefa"
+        // 更新进度
+        DispatchQueue.global().async {
+            PQUploadViewModel.getStsToken { [weak self] response, _ in
+                guard let wself = self else { return }
+                
+                if response == nil {
+                    BFLog(1, message: "token 获取失败")
+                    return
+                }
+                
+                BFLog(1, message: "取我方服务器STS 返回数据 \(String(describing: response))")
+                wself.multipartUpload(response: response)
+            }
+        }
+        
+        BFEventTrackAdaptor.baseReportUpload(businessType: .bt_uploadVideo, objectType: nil, pageSource: .sp_composePage, commonParams: commonParams())
+
+    }
+    
+    func multipartUpload(response: [String: Any]?) {
+        
+        uploadData.stsToken = response
+        PQAliOssUtil.multipartUpload(localPath: uploadData.localPath ?? "", response: response, videoSource: "videoCompose")
+        PQAliOssUtil.shared.aliOssHander = { [weak self] isMatarialUpload, materialType, _, code, objectkey, _, _, _, _, _, _, _, _, _ in
+            guard let wself = self else { return }
+            
+            if !isMatarialUpload, materialType == .VIDEO, code == 1 {
+                BFEventTrackAdaptor.baseReportUpload(businessType: .bt_uploadVideoSuccess, objectType: nil, pageSource: .sp_composePage, extParams: ["ossKey": objectkey ?? "none"], commonParams: commonParams())
+
+            }
+        }
+        
+    }
 }
 
 extension INVideoExportController {

+ 70 - 58
Podfile

@@ -16,65 +16,77 @@ target 'Introduce' do
   pod 'UMCSecurityPlugins',       '1.0.6'
   pod 'UMAPM',                    '1.5.5'
   pod 'Bugly',                    '2.5.91'
- 
-## Pods-for-AppStore
-#  pod 'BFCommonKit',           '1.5.9'
-#  pod 'BFNetRequestKit',       '1.0.3'
-#  pod 'BFUIKit',               '0.1.5'
-#  pod 'BFMaterialKit',         '0.2.7'
-#  pod 'BFLogger',              '0.1.0'
-#  pod 'BFMediaKit',            '0.0.2'
-#  pod 'BFRecordScreenKit',     '1.0.0'
+  # 内存泄漏检测
+  pod 'MLeaksFinder', :configurations => ['Debug']
 
-## Pods-for-Archive(Jenkins)
-#  pod 'BFCommonKit',           :git => 'https://git.yishihui.com/iOS/BFCommonKit.git'
-#  pod 'BFNetRequestKit',       :git => 'https://git.yishihui.com/iOS/BFNetRequestKit.git'
-#  pod 'BFUIKit',               :git => 'https://git.yishihui.com/iOS/BFUIKit.git'
-#  pod 'BFMaterialKit',         :git => 'https://git.yishihui.com/iOS/BFMaterialKit.git'
-#  pod 'BFLogger',              :git => 'https://git.yishihui.com/iOS/BFLogger.git'
-#  pod 'BFMediaKit',            :git => 'https://git.yishihui.com/iOS/BFMediaKit.git'
-#  pod 'BFRecordScreenKit',     :git => 'https://git.yishihui.com/iOS/BFRecordScreenKit.git'
-#  pod 'BFAnalyzeKit',          :git => 'https://git.yishihui.com/iOS/BFAnalyzeKit.git'
-#  pod "BFFFmpeglib",           :git => 'https://git.yishihui.com/iOS/BFFFmpeglib.git'
+  # 0:AppStore;  1:Jenkins;  2:hzq;  3:testing;
+  channel = 1
   
+  case channel
+    
+   when 0 # AppStore
+   
+     pod 'BFCommonKit',           '1.5.9'
+     pod 'BFNetRequestKit',       '1.0.3'
+     pod 'BFUIKit',               '0.1.5'
+     pod 'BFMaterialKit',         '0.2.7'
+     pod 'BFLogger',              '0.1.0'
+     pod 'BFMediaKit',            '0.0.2'
+     pod 'BFRecordScreenKit',     '1.0.0'
+     pod 'BFAnalyzeKit',          '0.1.0'
+     pod 'BFFFmpeglib',           '1.0.3'
+     pod 'BFUploadKit',           '0.1.0'
 
-
-#使用指定tag
-#  pod "BFCommonKit",       :git => 'https://git.yishihui.com/iOS/BFCommonKit.git',       :tag => '1.5.9'
-#  pod "BFNetRequestKit",   :git => 'https://git.yishihui.com/iOS/BFNetRequestKit.git',   :tag => '1.0.3'
-#  pod "BFUIKit",           :git => 'https://git.yishihui.com/iOS/BFUIKit.git',           :tag => '0.1.5'
-#  pod "BFMaterialKit",     :git => 'https://git.yishihui.com/iOS/BFMaterialKit.git',     :tag => '0.2.7'
-#  pod "BFLogger",          :git => 'https://git.yishihui.com/iOS/BFLogger.git',          :tag => '0.1.0'
-#  pod "BFMediaKit",        :git => 'https://git.yishihui.com/iOS/BFMediaKit.git',        :tag => '0.0.2'
-#  pod "BFRecordScreenKit", :git => 'https://git.yishihui.com/iOS/BFRecordScreenKit.git', :tag => '1.0.0'
-#  pod "BFAnalyzeKit",      :git => 'https://git.yishihui.com/iOS/BFAnalyzeKit.git',      :tag => '0.0.1'
-
-## ak:Pods-for-testing
-## zq:Pods-for-testing
-
-  pod 'BFCommonKit',           :path => '../BFCommonKit/'
-  pod 'BFNetRequestKit',       :path => '../BFNetRequestKit/'
-  pod 'BFUIKit',               :path => '../BFUIKit/'
-  pod 'BFMaterialKit',         :path => '../BFMaterialKit/'
-  pod 'BFLogger',              :path => '../BFLogger/'
-  pod 'BFMediaKit',            :path => '../BFMediaKit/'
-  pod 'BFRecordScreenKit',     :path => '../BFRecordScreenKit/'
-  pod 'BFAnalyzeKit',          :path => '../BFAnalyzeKit/'
-  pod 'BFFFmpeglib',           :path => '../BFFFmpeglib/'
-  
-  pod 'MLeaksFinder'
-#  pod 'PLCrashReporter'
-
-
-## ww:Pods-for-testing
-#  pod 'BFCommonKit',           :path => '../../BFCommonKit/Trunk'
-#  pod 'BFNetRequestKit',       :path => '../../BFNetRequestKit/Trunk'
-#  pod 'BFUIKit',               :path => '../../BFUIKit/Trunk'
-#  pod 'BFMaterialKit',         :path => '../../BFMaterialKit/Trunk'
-#  pod 'BFLogger',              :path => '../../BFLogger/Trunk'
-#  pod 'BFMediaKit',            :path => '../../BFMediaKit/Trunk'
-#  pod 'BFRecordScreenKit',     :path => '../../BFRecordScreenKit/Trunk'
-#  pod 'BFAnalyzeKit',          :path => '../../BFAnalyzeKit/Trunk'
+     
+   when 1 # jenkins
+   
+     pod 'BFCommonKit',           :git => 'https://git.yishihui.com/iOS/BFCommonKit.git'
+     pod 'BFNetRequestKit',       :git => 'https://git.yishihui.com/iOS/BFNetRequestKit.git'
+     pod 'BFUIKit',               :git => 'https://git.yishihui.com/iOS/BFUIKit.git'
+     pod 'BFMaterialKit',         :git => 'https://git.yishihui.com/iOS/BFMaterialKit.git'
+     pod 'BFLogger',              :git => 'https://git.yishihui.com/iOS/BFLogger.git'
+     pod 'BFMediaKit',            :git => 'https://git.yishihui.com/iOS/BFMediaKit.git',:branch => 'dev'
+     pod 'BFRecordScreenKit',     :git => 'https://git.yishihui.com/iOS/BFRecordScreenKit.git',:branch => 'dev'
+     pod 'BFAnalyzeKit',          :git => 'https://git.yishihui.com/iOS/BFAnalyzeKit.git'
+     pod "BFFFmpeglib",           :git => 'https://git.yishihui.com/iOS/BFFFmpeglib.git'
+     pod "BFUploadKit",           :git => 'https://git.yishihui.com/iOS/BFUploadKit.git'
+   
+   when 2  # hzq
+   
+     pod 'BFCommonKit',           :path => '../BFCommonKit/'
+     pod 'BFNetRequestKit',       :path => '../BFNetRequestKit/'
+     pod 'BFUIKit',               :path => '../BFUIKit/'
+     pod 'BFMaterialKit',         :path => '../BFMaterialKit/'
+     pod 'BFLogger',              :path => '../BFLogger/'
+     pod 'BFMediaKit',            :path => '../BFMediaKit/'
+     pod 'BFRecordScreenKit',     :path => '../BFRecordScreenKit/'
+     pod 'BFAnalyzeKit',          :path => '../BFAnalyzeKit/'
+     pod 'BFFFmpeglib',           :path => '../BFFFmpeglib/'
+     pod 'BFUploadKit',           :path => '../BFUploadKit/'
+     
+  when 3  # testing
+     
+     pod 'BFCommonKit',           :path => '../../BFCommonKit/Trunk'
+     pod 'BFNetRequestKit',       :path => '../../BFNetRequestKit/Trunk'
+     pod 'BFUIKit',               :path => '../../BFUIKit/Trunk'
+     pod 'BFMaterialKit',         :path => '../../BFMaterialKit/Trunk'
+     pod 'BFLogger',              :path => '../../BFLogger/Trunk'
+     pod 'BFMediaKit',            :path => '../../BFMediaKit/Trunk'
+     pod 'BFRecordScreenKit',     :path => '../../BFRecordScreenKit/Trunk'
+     pod 'BFAnalyzeKit',          :path => '../../BFAnalyzeKit/Trunk'
+       
+   else
+   
+     pod "BFCommonKit",       :git => 'https://git.yishihui.com/iOS/BFCommonKit.git',       :tag => '1.5.9'
+     pod "BFNetRequestKit",   :git => 'https://git.yishihui.com/iOS/BFNetRequestKit.git',   :tag => '1.0.3'
+     pod "BFUIKit",           :git => 'https://git.yishihui.com/iOS/BFUIKit.git',           :tag => '0.1.5'
+     pod "BFMaterialKit",     :git => 'https://git.yishihui.com/iOS/BFMaterialKit.git',     :tag => '0.2.7'
+     pod "BFLogger",          :git => 'https://git.yishihui.com/iOS/BFLogger.git',          :tag => '0.1.0'
+     pod "BFMediaKit",        :git => 'https://git.yishihui.com/iOS/BFMediaKit.git',        :tag => '0.0.2'
+     pod "BFRecordScreenKit", :git => 'https://git.yishihui.com/iOS/BFRecordScreenKit.git', :tag => '1.0.0'
+     pod "BFAnalyzeKit",      :git => 'https://git.yishihui.com/iOS/BFAnalyzeKit.git',      :tag => '0.0.1'
+     
+  end
 
 
   
@@ -85,7 +97,8 @@ target 'Introduce' do
     remove_swift_ui("./Pods/Kingfisher/Sources/SwiftUI/ImageBinder.swift")
     remove_swift_ui("./Pods/Kingfisher/Sources/SwiftUI/KFImageOptions.swift")
     remove_swift_ui_realm("./Pods/RealmSwift/RealmSwift/SwiftUI.swift")
-#    remove_RealmSwift_swift_ui
+    remove_retaincyle("./Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/FBClassStrongLayout.mm")
+
     installer.pods_project.targets.each do |target|
       target.build_configurations.each do |config|
         config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
@@ -113,7 +126,6 @@ target 'Introduce' do
 
   def remove_retaincyle (code_file)
     code_text = File.read(code_file)
-#    code_text.gsub!(/layoutCache[currentClass] = ivars;/,'layoutCache[(id)currentClass] = ivars;')
     code_text.gsub!(/\[currentClass/,'[(id)currentClass')
     system("rm -rf " + code_file)