|  | @@ -96,6 +96,52 @@ class INVideoExportController: BFBaseViewController {
 | 
	
		
			
				|  |  |  //        vv.isHidden = true
 | 
	
		
			
				|  |  |          return vv
 | 
	
		
			
				|  |  |      }()
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +    lazy var errorView : UIView = {
 | 
	
		
			
				|  |  | +        let backV = UIView()
 | 
	
		
			
				|  |  | +        backV.backgroundColor = .black
 | 
	
		
			
				|  |  | +        backV.isHidden = true
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +        let titleL = UILabel()
 | 
	
		
			
				|  |  | +        titleL.text = "合成失败"
 | 
	
		
			
				|  |  | +        titleL.font = UIFont.systemFont(ofSize: 36)
 | 
	
		
			
				|  |  | +        titleL.textColor = .white
 | 
	
		
			
				|  |  | +        titleL.textAlignment = .center
 | 
	
		
			
				|  |  | +        backV.addSubview(titleL)
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +        let subTitleL = UILabel()
 | 
	
		
			
				|  |  | +        subTitleL.text = "请重新尝试"
 | 
	
		
			
				|  |  | +        subTitleL.tag = 33000
 | 
	
		
			
				|  |  | +        subTitleL.font = UIFont.systemFont(ofSize: 36)
 | 
	
		
			
				|  |  | +        subTitleL.textColor = UIColor.hexColor(hexadecimal: "#A6A6A6")
 | 
	
		
			
				|  |  | +        subTitleL.textAlignment = .center
 | 
	
		
			
				|  |  | +        backV.addSubview(subTitleL)
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +        let retryBtn = UIButton()
 | 
	
		
			
				|  |  | +        retryBtn.backgroundColor = ThemeStyleColor
 | 
	
		
			
				|  |  | +        retryBtn.addCorner(corner:5)
 | 
	
		
			
				|  |  | +        retryBtn.addTarget(self, action: #selector(retryAction), for: .touchUpInside)
 | 
	
		
			
				|  |  | +        backV.addSubview(retryBtn)
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +        retryBtn.snp.makeConstraints { make in
 | 
	
		
			
				|  |  | +            make.width.equalTo(245)
 | 
	
		
			
				|  |  | +            make.height.equalTo(50)
 | 
	
		
			
				|  |  | +            make.center.equalToSuperview()
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        subTitleL.snp.makeConstraints { make in
 | 
	
		
			
				|  |  | +            make.left.right.equalToSuperview()
 | 
	
		
			
				|  |  | +            make.height.equalTo(40)
 | 
	
		
			
				|  |  | +            make.bottom.equalTo(retryBtn.snp.top).offset(30)
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        titleL.snp.makeConstraints { make in
 | 
	
		
			
				|  |  | +            make.left.right.equalToSuperview()
 | 
	
		
			
				|  |  | +            make.height.equalTo(70)
 | 
	
		
			
				|  |  | +            make.bottom.equalTo(subTitleL.snp.top)
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +        return backV
 | 
	
		
			
				|  |  | +    }()
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      var playerLayer: AVPlayerLayer!
 | 
	
		
			
				|  |  |      lazy var avplayer: AVPlayer = {
 | 
	
	
		
			
				|  | @@ -133,7 +179,7 @@ class INVideoExportController: BFBaseViewController {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        export.exportCompletion = { [weak self] _, url in
 | 
	
		
			
				|  |  | +        export.exportCompletion = { [weak self] error, url in
 | 
	
		
			
				|  |  |              DispatchQueue.main.async { [weak self] in
 | 
	
		
			
				|  |  |                  guard let sself = self else {
 | 
	
		
			
				|  |  |                      return
 | 
	
	
		
			
				|  | @@ -167,6 +213,20 @@ class INVideoExportController: BFBaseViewController {
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                      // 添加播放进度视图
 | 
	
		
			
				|  |  |                      self?.addVideoSliderView()
 | 
	
		
			
				|  |  | +                }else {
 | 
	
		
			
				|  |  | +                    if let l = sself.errorView.viewWithTag(33000) as? UILabel, let err = error as NSError? {
 | 
	
		
			
				|  |  | +                        switch err.code {
 | 
	
		
			
				|  |  | +                        case ExportError.FileNotExist.rawValue :
 | 
	
		
			
				|  |  | +                            l.text = "原视频/图片文件被删除"
 | 
	
		
			
				|  |  | +                        case ExportError.DiskNoSpace.rawValue :
 | 
	
		
			
				|  |  | +                            l.text = "手机存储空间不足"
 | 
	
		
			
				|  |  | +                        case ExportError.VoiceLost.rawValue :
 | 
	
		
			
				|  |  | +                            l.text = "手机存储空间不足"
 | 
	
		
			
				|  |  | +                        default:
 | 
	
		
			
				|  |  | +                            l.text = "请重新尝试"
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                    sself.errorView.isHidden = false
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              // 合成成功上报
 | 
	
	
		
			
				|  | @@ -233,7 +293,8 @@ class INVideoExportController: BFBaseViewController {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          backV.addSubview(progressView)
 | 
	
		
			
				|  |  |          backV.addSubview(progressL)
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +        backV.addSubview(errorView)
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  |          bottomView.addSubview(saveAllBtn)
 | 
	
		
			
				|  |  |          bottomView.addSubview(saveOnlyBtn)
 | 
	
		
			
				|  |  |          bottomView.addSubview(saveToPhotoBtn)
 | 
	
	
		
			
				|  | @@ -319,7 +380,10 @@ class INVideoExportController: BFBaseViewController {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      // MARK: - 按钮事件
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +    @objc func retryAction(){
 | 
	
		
			
				|  |  | +        exportNow()
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  |      func exportNow() {
 | 
	
		
			
				|  |  |          if isExporting {
 | 
	
		
			
				|  |  |              cShowHUB(superView: nil, msg: "正在合成中。。。")
 |