Ver código fonte

回调不回是否设置播放器参数

jsonwang 4 anos atrás
pai
commit
3a17fafcd0

+ 4 - 4
BFFramework/Classes/Stuckpoint/View/PQSpeedSettingView.swift

@@ -86,7 +86,7 @@ class PQSpeedSettingView: UIView {
     }
 
     // 点击回调 maxSpeed,minSpeed 同时为0 说明点击的是自定义速度
-    public var selectSpeedCallBack: ((_ maxSpeed: Float, _ minSpeed: Float,_ selectIndex:Int) -> Void)?
+    public var selectSpeedCallBack: ((_ maxSpeed: Float, _ minSpeed: Float,_ selectIndex:Int,_ isSettingPlayer:Bool) -> Void)?
 
     override init(frame: CGRect) {
         super.init(frame: frame)
@@ -102,7 +102,7 @@ class PQSpeedSettingView: UIView {
     //设置默认选择的
     ///
     /// - Parameter index: 第几位 从0 开始
-    func setSelectItem(index:Int) {
+    func setSelectItem(index:Int,isSettingPlayer:Bool = true) {
        BFLog(message: "setSelectItem is \(index)")
         lastSelectModel?.isSelected = false
         if(viewType == 4){
@@ -123,9 +123,9 @@ class PQSpeedSettingView: UIView {
         if selectSpeedCallBack != nil {
             BFLog(message: "选择的速度为 max: \(lastSelectModel?.maxSpeed ?? 0.0) min: \(lastSelectModel?.minSpeed ?? 0.0)")
             if(lastSelectModel?.title == "自定义"){
-                selectSpeedCallBack!(-1,-1,index)
+                selectSpeedCallBack!(-1,-1,index,isSettingPlayer)
             }else{
-                selectSpeedCallBack!(lastSelectModel?.maxSpeed ?? 0.0, lastSelectModel?.minSpeed ?? 0.0,index)
+                selectSpeedCallBack!(lastSelectModel?.maxSpeed ?? 0.0, lastSelectModel?.minSpeed ?? 0.0,index,isSettingPlayer)
             }
  
         }