Explorar o código

字幕 的设置+编辑界面

jsonwang %!s(int64=3) %!d(string=hai) anos
pai
achega
368dffce85
Modificáronse 31 ficheiros con 575 adicións e 1 borrados
  1. 23 0
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle1.imageset/Contents.json
  2. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle1.imageset/wordStyle1.png
  3. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle1.imageset/wordStyle1@2x.png
  4. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle1.imageset/wordStyle1@3x.png
  5. 23 0
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle2.imageset/Contents.json
  6. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle2.imageset/wordStyle2.png
  7. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle2.imageset/wordStyle2@2x.png
  8. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle2.imageset/wordStyle2@3x.png
  9. 23 0
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle3.imageset/Contents.json
  10. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle3.imageset/wordStyle3.png
  11. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle3.imageset/wordStyle3@2x.png
  12. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle3.imageset/wordStyle3@3x.png
  13. 23 0
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle4.imageset/Contents.json
  14. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle4.imageset/wordStyle4.png
  15. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle4.imageset/wordStyle4@2x.png
  16. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle4.imageset/wordStyle4@3x.png
  17. 23 0
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle5.imageset/Contents.json
  18. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle5.imageset/wordStyle5.png
  19. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle5.imageset/wordStyle5@2x.png
  20. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle5.imageset/wordStyle5@3x.png
  21. 23 0
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle6.imageset/Contents.json
  22. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle6.imageset/wordStyle6.png
  23. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle6.imageset/wordStyle6@2x.png
  24. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle6.imageset/wordStyle6@3x.png
  25. 23 0
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle7.imageset/Contents.json
  26. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle7.imageset/wordStyle7.png
  27. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle7.imageset/wordStyle7@2x.png
  28. BIN=BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle7.imageset/wordStyle7@3x.png
  29. 23 1
      BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenController.swift
  30. 120 0
      BFRecordScreenKit/Classes/RecordScreen/View/BFSubtitleEditView.swift
  31. 271 0
      BFRecordScreenKit/Classes/RecordScreen/View/BFSubtitleSettingView.swift

+ 23 - 0
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle1.imageset/Contents.json

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

BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle1.imageset/wordStyle1.png


BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle1.imageset/wordStyle1@2x.png


BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle1.imageset/wordStyle1@3x.png


+ 23 - 0
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle2.imageset/Contents.json

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

BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle2.imageset/wordStyle2.png


BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle2.imageset/wordStyle2@2x.png


BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle2.imageset/wordStyle2@3x.png


+ 23 - 0
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle3.imageset/Contents.json

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

BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle3.imageset/wordStyle3.png


BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle3.imageset/wordStyle3@2x.png


BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle3.imageset/wordStyle3@3x.png


+ 23 - 0
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle4.imageset/Contents.json

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

BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle4.imageset/wordStyle4.png


BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle4.imageset/wordStyle4@2x.png


BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle4.imageset/wordStyle4@3x.png


+ 23 - 0
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle5.imageset/Contents.json

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

BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle5.imageset/wordStyle5.png


BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle5.imageset/wordStyle5@2x.png


BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle5.imageset/wordStyle5@3x.png


+ 23 - 0
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle6.imageset/Contents.json

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

BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle6.imageset/wordStyle6.png


BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle6.imageset/wordStyle6@2x.png


BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle6.imageset/wordStyle6@3x.png


+ 23 - 0
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle7.imageset/Contents.json

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

BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle7.imageset/wordStyle7.png


BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle7.imageset/wordStyle7@2x.png


BIN=BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordStyle7.imageset/wordStyle7@3x.png


+ 23 - 1
BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenController.swift

@@ -223,6 +223,20 @@ public class BFRecordScreenController: BFBaseViewController {
         btn.addTarget(self, action: #selector(soundSetting), for: .touchUpInside)
         return btn
     }()
+    
+    //字幕设置面板
+    lazy var subtitleView:BFSubtitleSettingView = {
+        let subtitleView = BFSubtitleSettingView.init(frame: CGRect.init(x: 0, y: 0, width: cScreenWidth, height: cScreenHeigth))
+        subtitleView.isHidden = true
+        return subtitleView
+    }()
+    
+    //编辑字幕
+    lazy var subtitleEditView:BFSubtitleEditView = {
+        let subtitleEditView = BFSubtitleEditView.init(frame: CGRect.init(x: 0, y: 0, width: cScreenWidth, height: cScreenHeigth))
+        subtitleEditView.isHidden = true
+        return subtitleEditView
+    }()
  
      
     lazy var progressThumV : BFVideoThumbProgressView = {
@@ -290,6 +304,8 @@ public class BFRecordScreenController: BFBaseViewController {
 //        view.addSubview(drawPinBtn)
         view.addSubview(subtitleBtn)
         view.addSubview(soundSettingBtn)
+        view.addSubview(subtitleView)
+      
         
         bottomeView.addSubview(progreddL)
 //        view.addSubview(toolV)
@@ -309,6 +325,8 @@ public class BFRecordScreenController: BFBaseViewController {
         }
         
         layoutsubview()
+        
+        view.addSubview(subtitleEditView)
     }
     func layoutsubview() {
 
@@ -379,7 +397,7 @@ public class BFRecordScreenController: BFBaseViewController {
             make.width.equalTo(40)
             make.height.equalTo(62)
         }
- 
+        
         withDrawBtn.imageEdgeInsets = UIEdgeInsets(top: -withDrawBtn.imageView!.height, left: 0, bottom: 0, right: -withDrawBtn.titleLabel!.width);
         withDrawBtn.titleEdgeInsets = UIEdgeInsets(top: withDrawBtn.titleLabel!.height + 2, left: -withDrawBtn.imageView!.width, bottom: 0, right: 0);
         
@@ -460,6 +478,10 @@ public class BFRecordScreenController: BFBaseViewController {
     //字幕
     @objc func subTitleClick(){
          BFLog(message: "subTitle Click ")
+//        subtitleView.isHidden = !subtitleView.isHidden
+        
+        subtitleEditView.isHidden = !subtitleEditView.isHidden
+        subtitleEditView.textView.becomeFirstResponder()
     }
     //声音设置
     @objc func soundSetting(){

+ 120 - 0
BFRecordScreenKit/Classes/RecordScreen/View/BFSubtitleEditView.swift

@@ -0,0 +1,120 @@
+//
+//  BFSubtitleEditView.swift
+//  BFRecordScreenKit
+//
+//  Created by ak on 2021/12/8.
+//
+
+import Foundation
+import BFUIKit
+import BFFramework
+class BFSubtitleEditView: UIView {
+    
+    /// 输入框
+    lazy var textView: BFTextView = {
+        let textView = BFTextView()
+        textView.maxTextLength = 300
+        textView.maxTextLengthRemind = ""
+        textView.backgroundColor = UIColor.clear
+        textView.textColor = UIColor.hexColor(hexadecimal: "#FFFFFF")
+        textView.tintColor = UIColor.hexColor(hexadecimal: "#EE0051")
+        textView.font = UIFont.systemFont(ofSize: 17)
+        textView.placeHolder = ""
+        textView.placeHolderColor = UIColor.hexColor(hexadecimal: "#555555")
+        textView.delegate = self
+
+        
+        textView.textDidChangedHandle = { [weak self] textView in
+          
+        }
+        if #available(iOS 11.0, *) {
+            textView.contentInsetAdjustmentBehavior = .never
+        }
+        return textView
+    }()
+    
+    required init?(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+        
+    }
+    override init(frame: CGRect) {
+       super.init(frame: frame)
+        backgroundColor = .black
+        alpha = 0.7
+        addSubview(textView)
+        textView.snp.makeConstraints { make in
+            make.left.equalTo(37)
+            make.width.equalTo(300)
+            make.height.equalTo(280)
+            make.top.equalToSuperview().offset(134)
+        }
+        
+        
+        let doneBtn = UIButton()
+        doneBtn.backgroundColor = UIColor.hexColor(hexadecimal: "#28BE67")
+        doneBtn.setTitle("完成", for: .normal)
+        doneBtn.titleLabel?.font = UIFont.systemFont(ofSize: 16)
+        doneBtn.addTarget(self, action: #selector(doneAction), for: .touchUpInside)
+        addSubview(doneBtn)
+        doneBtn.snp.makeConstraints { make in
+            make.right.equalTo(-12)
+            make.width.equalTo(60)
+            make.height.equalTo(36)
+            make.top.equalToSuperview().offset(45)
+        }
+        
+        let cancelBtn = UIButton()
+        cancelBtn.backgroundColor = .clear
+        cancelBtn.setTitle("取消", for: .normal)
+        cancelBtn.setTitleColor(.white, for: .normal)
+        cancelBtn.titleLabel?.font = UIFont.systemFont(ofSize: 16)
+        cancelBtn.addTarget(self, action: #selector(cancelAction), for: .touchUpInside)
+        addSubview(cancelBtn)
+        cancelBtn.snp.makeConstraints { make in
+            make.left.equalToSuperview().offset(12)
+            make.width.equalTo(60)
+            make.height.equalTo(36)
+            make.top.equalToSuperview().offset(45)
+        }
+        
+
+
+    
+       
+        
+    }
+    
+    @objc func cancelAction(){
+        self.isHidden = true
+    }
+    
+    @objc func doneAction(){
+        self.isHidden = true
+    }
+    
+
+}
+
+extension BFSubtitleEditView: UITextViewDelegate{
+    
+    func textViewDidBeginEditing(_ textView: UITextView) {
+       
+    }
+
+    func textViewDidEndEditing(_ textView: UITextView) {
+     
+        BFLog(message: "textViewDidEndEditing 输入完成 \(textView.text ?? "")")
+    }
+
+    func textView(_: UITextView, shouldChangeTextIn _: NSRange, replacementText text: String) -> Bool {
+        if text.isEmoji() {
+            cShowHUB(superView: nil, msg: "不能输入表情")
+            return false
+        }
+        BFLog(message: "inputText \(String(describing: textView.text))")
+        
+        let attributedText = NSMutableAttributedString(string: textView.text,attributes: [.font: UIFont.systemFont(ofSize: 34),.strokeWidth:-3,.strokeColor:UIColor.orange])
+        textView.attributedText = attributedText
+        return true
+    }
+}

+ 271 - 0
BFRecordScreenKit/Classes/RecordScreen/View/BFSubtitleSettingView.swift

@@ -0,0 +1,271 @@
+//
+//  BFSubtitleSettingView.swift
+//  BFRecordScreenKit
+//
+//  Created by ak on 2021/12/7.
+//  功能:设置字幕操作面板
+
+import Foundation
+import BFFramework
+import BFCommonKit
+
+typealias SubtitleSettingCallBack = (_ subtitileSettingModel: BFSubtitileSettingModel?) -> Void
+
+class BFSubtitleSettingView: UIView {
+    
+    required init?(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+        
+    }
+    
+    //最后一次选择的样式 BTN
+    var lastSelectStyleBtn:UIButton = UIButton.init();
+    //最后一次选择的位置 BTN
+    var lastSelectPointBtn:UIButton = UIButton.init();
+    //最后一次选择的字号的 BTN
+    var lastSelectwordSizeBtn:UIButton = UIButton.init();
+    
+    var subtitleSettingCallBack:SubtitleSettingCallBack?
+    
+    var subtitleSetting:BFSubtitileSettingModel = BFSubtitileSettingModel.init()
+     
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        
+        self.backgroundColor = UIColor.clear
+        addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(hidden)))
+        
+        let backView = UIView.init(frame: CGRect.init(x: 0, y: 0, width: cScreenWidth, height: cScreenHeigth))
+        backView.backgroundColor = .black
+        addSubview(backView)
+        backView.snp.makeConstraints { make in
+            make.right.equalTo(self.snp.right)
+            make.bottom.equalTo(self.snp.bottom)
+            make.width.equalTo(cScreenWidth)
+            make.height.equalTo(220)
+        }
+      
+        
+        //字体样式
+        for i in 0...6 {
+            let btn = UIButton(type: .custom)
+            btn.setImage(imageInRecordScreenKit(by: "wordStyle\(i + 1)"), for: .normal)
+//            btn.setBackgroundImage(UIImage.init(color:
+//                                                    UIColor.hexColor(hexadecimal: "#28BE67")), for: .selected)
+            btn.setBackgroundImage(UIImage.init(color:
+                                                    .black), for: .normal)
+            btn.frame = CGRect.init(x: 18 + i * ( 40 + 10) , y: 22, width: 40, height: 40)
+            if(i == 0){
+                btn.isSelected = true
+                btn.layer.borderColor = UIColor.hexColor(hexadecimal: "#28BE67").cgColor
+                btn.layer.borderWidth = 1.5
+                lastSelectStyleBtn = btn
+            }
+        
+            btn.addTarget(self, action: #selector(styleSetting(sender:)), for: .touchUpInside)
+            backView.addSubview(btn)
+            btn.addCorner(corner: 20.0)
+
+        }
+        
+        //位置
+        let pointTitle = UILabel()
+        pointTitle.textAlignment = .center
+        pointTitle.font = UIFont.systemFont(ofSize: 15)
+        pointTitle.textColor = .white
+        pointTitle.text = "位置"
+        pointTitle.alpha = 0.6
+        backView.addSubview(pointTitle)
+        pointTitle.snp.makeConstraints { make in
+            make.width.equalTo(40)
+            make.height.equalTo(25)
+            make.left.equalToSuperview().offset(16)
+            make.top.equalToSuperview().offset(89)
+        }
+        for i  in 0...2 {
+            let pointBtn = UIButton(type: .custom)
+            pointBtn.setTitleColor(UIColor.hexColor(hexadecimal: "#28BE67"), for: .selected)
+            pointBtn.setTitleColor(.white, for: .normal)
+            pointBtn.addTarget(self, action: #selector(pointSetting(sender:)), for: .touchUpInside)
+            pointBtn.backgroundColor = UIColor.hexColor(hexadecimal: "#1A1A1A")
+            if(i == 0){
+                pointBtn.isSelected = true
+                pointBtn.layer.borderColor = UIColor.hexColor(hexadecimal: "#28BE67").cgColor
+                pointBtn.layer.borderWidth = 1.5
+                lastSelectPointBtn = pointBtn
+                pointBtn.setTitle("下", for: .normal)
+            }else if(i == 1){
+                pointBtn.setTitle("中", for: .normal)
+            }else{
+                pointBtn.setTitle("上", for: .normal)
+            }
+            pointBtn.addCorner(corner:10)
+            pointBtn.tag = i
+            backView.addSubview(pointBtn)
+            pointBtn.snp.makeConstraints { make in
+                make.width.equalTo(40)
+                make.height.equalTo(30)
+                make.centerX.equalTo(pointTitle.snp.centerX).offset(60 + i * (Int(40  + 10)))
+                
+                make.centerY.equalTo(pointTitle.snp.centerY)
+            }
+            
+            
+        }    
+        
+        //字号
+        let wordSizeTitle = UILabel()
+        wordSizeTitle.textAlignment = .center
+        wordSizeTitle.font = UIFont.systemFont(ofSize: 15)
+        wordSizeTitle.textColor = .white
+        wordSizeTitle.text = "字号"
+        wordSizeTitle.alpha = 0.6
+        backView.addSubview(wordSizeTitle)
+        wordSizeTitle.snp.makeConstraints { make in
+            make.width.equalTo(40)
+            make.height.equalTo(25)
+            make.right.equalToSuperview().offset(-100)
+            make.top.equalTo(pointTitle.snp.top)
+        }
+        for i  in 0...1 {
+            let wordSizeBtn = UIButton(type: .custom)
+            wordSizeBtn.addTarget(self, action: #selector(wordSizeSetting(sender:)), for: .touchUpInside)
+            wordSizeBtn.backgroundColor = UIColor.hexColor(hexadecimal: "#1A1A1A")
+            wordSizeBtn.setTitleColor(UIColor.hexColor(hexadecimal: "#28BE67"), for: .selected)
+            wordSizeBtn.setTitleColor(.white, for: .normal)
+            wordSizeBtn.setTitle(i == 0 ? "-" : "+", for: .normal)
+            backView.addSubview(wordSizeBtn)
+            wordSizeBtn.tag = i
+            if(i == 0){
+                wordSizeBtn.isSelected = true
+                wordSizeBtn.layer.borderColor = UIColor.hexColor(hexadecimal: "#28BE67").cgColor
+                wordSizeBtn.layer.borderWidth = 1.5
+                lastSelectwordSizeBtn = wordSizeBtn
+            }
+            wordSizeBtn.addCorner(corner:10)
+            wordSizeBtn.snp.makeConstraints { make in
+                make.width.equalTo(30)
+                make.height.equalTo(30)
+                make.left.equalTo(wordSizeTitle.snp.right).offset( 10 + i * (Int(30  + 10)))
+                
+                make.centerY.equalTo(pointTitle.snp.centerY)
+            }
+            
+            
+        }
+        //就是一个线
+        let line = UIView.init()
+        line.backgroundColor =  UIColor.hexColor(hexadecimal: "#121212")
+        backView.addSubview(line)
+        
+        line.snp.makeConstraints { make in
+            make.width.equalTo(340)
+            make.height.equalTo(2)
+            make.left.equalToSuperview().offset(18)
+            make.top.equalTo(wordSizeTitle.snp.bottom).offset(23)
+        }
+        
+        //不显示字幕
+        let disabelTitle = UILabel()
+        disabelTitle.textAlignment = .left
+        disabelTitle.font = UIFont.boldSystemFont(ofSize: 17)
+        disabelTitle.textColor = .white
+        disabelTitle.text = "不显示字幕"
+        backView.addSubview(disabelTitle)
+        disabelTitle.snp.makeConstraints { make in
+            make.width.equalTo(100)
+            make.height.equalTo(24)
+            make.left.equalToSuperview().offset(18)
+            make.top.equalTo(line.snp.top).offset(17)
+        }
+        // 创建switch
+        let disabeSwitch = UISwitch()
+        disabeSwitch.isOn = false
+        backView.addSubview(disabeSwitch)
+        disabeSwitch.addTarget(self, action: #selector(switchChange(uiswitch:)), for: .valueChanged)
+        disabeSwitch.snp.makeConstraints { make in
+            make.width.equalTo(51)
+            make.height.equalTo(31)
+            make.right.equalToSuperview().offset(-18)
+            make.top.equalTo(line.snp.top).offset(13)
+        }
+     
+        
+        
+        //        addCorner(roundingCorners: .topLeft, corner: 10)
+        //        addCorner(roundingCorners: .topRight, corner: 10)
+        BFLog(message: "")
+        
+    }
+    
+    @objc func hidden(){
+        self.isHidden = true
+    }
+    
+    @objc func styleSetting(sender: UIButton){
+        lastSelectStyleBtn.isSelected = false
+        lastSelectStyleBtn.layer.borderColor = UIColor.clear.cgColor
+        
+        sender.isSelected = true
+        lastSelectStyleBtn = sender
+        
+        sender.layer.borderColor = UIColor.hexColor(hexadecimal: "#28BE67").cgColor
+        sender.layer.borderWidth = 1.5
+        
+        subtitleSetting.subtitleStyle = sender.tag
+    }
+    @objc func pointSetting(sender:UIButton){
+        
+        lastSelectPointBtn.isSelected = false
+        lastSelectPointBtn.layer.borderColor = UIColor.clear.cgColor
+        
+        sender.isSelected = true
+        lastSelectPointBtn = sender
+        
+        sender.layer.borderColor = UIColor.hexColor(hexadecimal: "#28BE67").cgColor
+        sender.layer.borderWidth = 1.5
+        
+        subtitleSetting.subtitlePoint = sender.tag
+    
+        
+    }
+    @objc func wordSizeSetting(sender:UIButton){
+     
+        lastSelectwordSizeBtn.isSelected = false
+        lastSelectwordSizeBtn.layer.borderColor = UIColor.clear.cgColor
+        
+        sender.isSelected = true
+        lastSelectwordSizeBtn = sender
+        
+        sender.layer.borderColor = UIColor.hexColor(hexadecimal: "#28BE67").cgColor
+        sender.layer.borderWidth = 1.5
+        if(sender.tag == 0){
+            subtitleSetting.subtitleSize -= 10
+        }else{
+            subtitleSetting.subtitleSize += 10
+        }
+        
+    }
+    @objc func switchChange(uiswitch:UISwitch) {
+        print("字幕开关状态\(uiswitch.isOn )")
+        
+        subtitleSetting.subtitleIsShow = !uiswitch.isOn
+        
+        
+    }
+}
+
+class BFSubtitileSettingModel: NSObject {
+    
+    //字幕样式 值说明0 1 2 3 4 5 6
+    var subtitleStyle:Int = 0
+    //字幕位置 值说明 0 下 1 中 2 上
+    var subtitlePoint:Int = 0
+    
+    //字幕文字大小 60px
+    var subtitleSize:Int = 60
+    
+    //字幕是否显示
+    var subtitleIsShow:Bool = true
+    
+}