|
@@ -17,13 +17,13 @@ class VideoExportController: BFBaseViewController{
|
|
|
var videoAsset : AVURLAsset?
|
|
|
|
|
|
lazy var progressView : UIView = {
|
|
|
- let v = UIView(frame: CGRect(x: 10, y: 100, width: 0, height: 30))
|
|
|
+ let v = UIView(frame: CGRect(x: 0, y: cDevice_iPhoneStatusBarHei, width: 0, height: 30))
|
|
|
v.backgroundColor = .red
|
|
|
return v
|
|
|
}()
|
|
|
|
|
|
lazy var progressL : UILabel = {
|
|
|
- let la = UILabel(frame: CGRect(x: 10, y: 100, width: cScreenWidth - 20, height: 30))
|
|
|
+ let la = UILabel(frame: CGRect(x: 0, y: cDevice_iPhoneStatusBarHei, width: cScreenWidth, height: 30))
|
|
|
la.textColor = .white
|
|
|
la.text = "0%"
|
|
|
la.font = UIFont.systemFont(ofSize: 18)
|
|
@@ -34,7 +34,7 @@ class VideoExportController: BFBaseViewController{
|
|
|
let export = BFRecordExport()
|
|
|
|
|
|
export.progress = {[weak self] progress in
|
|
|
- self?.progressView.frame = CGRect(x: 10, y: 100, width: (cScreenWidth - 20) * CGFloat(progress), height: 30)
|
|
|
+ self?.progressView.frame = CGRect(x: 0, y: cDevice_iPhoneStatusBarHei, width: (cScreenWidth) * CGFloat(progress), height: 30)
|
|
|
self?.progressL.text = String(format: "%d", Int(progress*100))
|
|
|
}
|
|
|
export.exportCompletion = {[weak self] (error, url) in
|
|
@@ -47,7 +47,7 @@ class VideoExportController: BFBaseViewController{
|
|
|
let item = AVPlayerItem(url: fileUrl)
|
|
|
let avplayer = AVPlayer(playerItem: item)
|
|
|
let playerLayer = AVPlayerLayer(player: avplayer)
|
|
|
- playerLayer.frame = CGRect(x: 10, y: strongSelf.progressView.bottomY+5, width: cScreenWidth - 20, height: cScreenHeigth - strongSelf.progressView.bottomY - 10)
|
|
|
+ playerLayer.frame = CGRect(x: 10, y: strongSelf.progressView.bottomY, width: cScreenWidth - 20, height: cScreenHeigth - strongSelf.progressView.bottomY - 10)
|
|
|
strongSelf.view.layer.addSublayer(playerLayer)
|
|
|
avplayer.play()
|
|
|
}
|
|
@@ -55,6 +55,16 @@ class VideoExportController: BFBaseViewController{
|
|
|
}
|
|
|
return export
|
|
|
}()
|
|
|
+
|
|
|
+ override func viewWillAppear(_ animated: Bool) {
|
|
|
+ super.viewWillAppear(animated)
|
|
|
+ showNavigation()
|
|
|
+ }
|
|
|
+
|
|
|
+ override func backBtnClick() {
|
|
|
+ export.cancelExport()
|
|
|
+ super.backBtnClick()
|
|
|
+ }
|
|
|
|
|
|
override func viewDidLoad() {
|
|
|
super.viewDidLoad()
|
|
@@ -65,6 +75,6 @@ class VideoExportController: BFBaseViewController{
|
|
|
view.addSubview(progressView)
|
|
|
view.addSubview(progressL)
|
|
|
|
|
|
- export.start()
|
|
|
+ export.startExprot()
|
|
|
}
|
|
|
}
|