Prechádzať zdrojové kódy

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

jsonwang 3 rokov pred
rodič
commit
49897411fb

+ 1 - 25
BFCommonKit.podspec

@@ -9,29 +9,17 @@
 Pod::Spec.new do |s|
   s.name             = 'BFCommonKit'
   s.version          = '1.5.1'
-  s.summary          = 'A short description of BFCommonKit.'
+  s.summary          = '基础库'
   s.swift_version    = '5.0'
-# This description is used to generate tags and improve search results.
-#   * Think: What does it do? Why did you write it? What is the focus?
-#   * Try to keep it short, snappy and to the point.
-#   * Write the description between the DESC delimiters below.
-#   * Finally, don't worry about the indent, CocoaPods strips it!
-
   s.description      = <<-DESC
 TODO: Add long description of the pod here.
                        DESC
 
   s.homepage         = 'https://git.yishihui.com/iOS'
-  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
   s.license          = { :type => 'MIT', :file => 'LICENSE' }
   s.author           = { 'wenweiwei' => 'wenweiwei@piaoquantv.com' }
   s.source           = { :git => 'https://git.yishihui.com/iOS/BFCommonKit.git', :tag => s.version.to_s }
-  # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
-
   s.ios.deployment_target = '10.0'
-
-#  s.source_files = 'BFCommonKit/Classes/BFConfig/*'
-  # subspec
   s.subspec 'BFConfig' do |gg|
     gg.source_files = 'BFCommonKit/Classes/BFConfig/*'
     gg.frameworks = 'UIKit'
@@ -70,19 +58,7 @@ TODO: Add long description of the pod here.
     dd.frameworks = 'UIKit','MessageUI','WebKit'
     dd.dependency 'BFCommonKit/BFCategorys'
   end
-#  s.subspec 'Resources' do |rr|
-#    rr.resource_bundles = {
-#      'BFCommonKit_Resources' => ['BFCommonKit/Assets/Resources/*']
-#    }
-#  end
-
    s.resource_bundles = {
       'BFCommonKit_Resources' => ['BFCommonKit/Assets/*']
     }
-  # s.resources = 'BFCommonKit/Assets/Resources/*.png'
-  # s.public_header_files = 'Pod/Classes/**/*.h'
-  # s.frameworks = 'UIKit', 'AVFoundation','CoreMedia', 'QuartzCore'
-  # s.dependency 'Kingfisher','6.3.0'
-
-  
 end

+ 3 - 1
BFCommonKit/Classes/BFConfig/BFConfig.swift

@@ -89,7 +89,9 @@ public class BFConfig: NSObject {
     public var appType: String = "15"
     // 苹果后台创建的 APPID
     public var appId: String = "1570572849"
-
+    /// 腾讯兔小巢反馈 AppId 票圈视频:275642     乐活圈:351068
+    public var txFeedbackAppId: String = "351068"
+    
     // 是否可打印 LOG
     public var enableBFLog: Bool = false
     

+ 2 - 0
BFCommonKit/Classes/BFEnums/Enums.swift

@@ -54,7 +54,9 @@ public  enum  PAGESOURCE: String {
     case sp_videoDetail_search_recommend = "speedApp-videoDetail_search_recommend" // 由搜索结果列表进入
     case sp_videoDetail_upload = "speedApp-videoDetail_upload" //     由我的tab中“作品”列表进入
     case sp_videoDetail_upload_recommend = "speedApp-videoDetail_upload_recommend" // 、由我的tab中“作品”列表进入
+    case sp_mine_favorite = "speedApp_mine_favorite" // 我的喜欢列表
     case sp_videoDetail_favorite = "speedApp-videoDetail_favorite" // 由我的喜欢列表进入
+    
     case sp_videoDetail_share = "speedApp-videoDetail_share" // 由我的分享列表进入
     case sp_videoDetail_favorite_recommend = "speedApp-videoDetail_favorite_recommend" // 由我的喜欢列表推荐
     case sp_userHomePage = "speedApp-userHomePage" // 用户个人主页

+ 17 - 11
BFCommonKit/Classes/BFUtility/NXAudioRecorder.swift

@@ -32,7 +32,7 @@ public class NXAudioRecorder {
     /// 初始化录音器
     /// - Parameter path: 保存的文件全路径,注意文件后缀一定要是 caf
     /// - Throws: description
-    public init(path: String) throws {
+    public init(path: String, setting:[String: Any]? = nil) throws {
         // 1,判断目录文件夹是否存在
         recordFilePath = path
         BFLog(message: "recorder file path is \(String(describing: recordFilePath))")
@@ -40,15 +40,20 @@ public class NXAudioRecorder {
         // 2,参数
         let fileURL = URL(fileURLWithPath: recordFilePath)
         // 注意设置参数 设置不对就无法录制
-        let settings: [String: Any] = [
-            AVFormatIDKey: kAudioFormatLinearPCM,
-            AVSampleRateKey: 16000.0,
-            AVNumberOfChannelsKey: 1,
-            AVEncoderBitDepthHintKey: 16,
-//            AVLinearPCMIsFloatKey:true, // 不要打开ios 13有杂音
-            AVEncoderAudioQualityKey: AVAudioQuality.max.rawValue, // 录音质量
-        ]
-        recorder = try AVAudioRecorder(url: fileURL, settings: settings)
+        
+        var settings = setting
+        if settings == nil {
+            settings = [
+                AVFormatIDKey: kAudioFormatLinearPCM,
+                AVSampleRateKey: 16000.0,
+                AVNumberOfChannelsKey: 1,
+                AVEncoderBitDepthHintKey: 16,
+                //            AVLinearPCMIsFloatKey:true, // 不要打开ios 13有杂音
+                AVEncoderAudioQualityKey: AVAudioQuality.max.rawValue, // 录音质量
+            ]
+            
+        }
+        recorder = try AVAudioRecorder(url: fileURL, settings: settings!)
         recorder.isMeteringEnabled = true
         recorder.delegate = delegateHandler
         recorder.prepareToRecord()
@@ -91,11 +96,12 @@ public class NXAudioRecorder {
 
     // 停止录制
     public func stopRecord(_ closure: @escaping (_ isSuccess: Bool, _ url: String) -> Void) {
+        stopTimer()
+        
         if !recorder.isRecording {
             BFLog(message: "不是录制状态")
         }
 
-        stopTimer()
 
         delegateHandler.finishClosure = closure
 

+ 0 - 1
BFCommonKit/Classes/BFUtility/PQConstant.swift

@@ -247,7 +247,6 @@ public let cFinishedPublishedNotiKey: String = "finishedPublishedNotiKey\(cPrima
 
 // oss 上传文件进度 add by ak
 public let cOSSUploadFileProgress: String = "OSSUploadFileProgress\(cPrimarykey)"
-
 // 渠道
 public let channelID = "AppStore"
 // 推送渠道