|
@@ -248,13 +248,65 @@ class INVideoExportController: BFBaseViewController {
|
|
|
|
|
|
override func viewWillAppear(_ animated: Bool) {
|
|
override func viewWillAppear(_ animated: Bool) {
|
|
super.viewWillAppear(animated)
|
|
super.viewWillAppear(animated)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ PQNotification.addObserver(self, selector: #selector(enterBackground), name: UIApplication.didEnterBackgroundNotification, object: nil)
|
|
|
|
+ PQNotification.addObserver(self, selector: #selector(willEnterForeground), name: UIApplication.willEnterForegroundNotification, object: nil)
|
|
|
|
+
|
|
|
|
+ //进入活跃状态
|
|
|
|
+ PQNotification.addObserver(self, selector: #selector(didBecomeActive), name: UIApplication.didBecomeActiveNotification, object: nil)
|
|
|
|
+
|
|
|
|
+ //进入非活跃状态
|
|
|
|
+ PQNotification.addObserver(self, selector: #selector(willResignActive), name: UIApplication.willResignActiveNotification, object: nil)
|
|
|
|
+
|
|
showNavigation()
|
|
showNavigation()
|
|
// 曝光上报
|
|
// 曝光上报
|
|
BFEventTrackAdaptor.baseReportUpload(businessType: .bt_pageView, objectType: nil, pageSource: .sp_composePage, commonParams: commonParams())
|
|
BFEventTrackAdaptor.baseReportUpload(businessType: .bt_pageView, objectType: nil, pageSource: .sp_composePage, commonParams: commonParams())
|
|
}
|
|
}
|
|
|
|
+ @objc func didBecomeActive(){
|
|
|
|
+ BFLog(message: "进入活跃状态")
|
|
|
|
+ if let sbtn = sliderView?.viewWithTag(1) as? UIButton ,!isExporting {
|
|
|
|
+ sbtn.isSelected = false
|
|
|
|
+ avplayer.play()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @objc func willResignActive(){
|
|
|
|
+ BFLog(message: "进入非活跃状态")
|
|
|
|
+ if let sbtn = sliderView?.viewWithTag(1) as? UIButton , !isExporting{
|
|
|
|
+ sbtn.isSelected = true
|
|
|
|
+ avplayer.pause()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @objc func enterBackground() {
|
|
|
|
+ BFLog(message: "进入到后台")
|
|
|
|
+
|
|
|
|
+ if isExporting {
|
|
|
|
+ self.export.cancelExport()
|
|
|
|
+ }else{
|
|
|
|
+ if let sbtn = sliderView?.viewWithTag(1) as? UIButton {
|
|
|
|
+ sbtn.isSelected = true
|
|
|
|
+ avplayer.pause()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @objc func willEnterForeground() {
|
|
|
|
+ BFLog(message: "进入到前台")
|
|
|
|
+ export.startExprot(synthesisAll: saveAllBtn.isSelected)
|
|
|
|
+ //重启播放器
|
|
|
|
+ if let sbtn = sliderView?.viewWithTag(1) as? UIButton {
|
|
|
|
+ sbtn.isSelected = false
|
|
|
|
+ avplayer.play()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
override func viewWillDisappear(_ animated: Bool) {
|
|
override func viewWillDisappear(_ animated: Bool) {
|
|
super.viewWillDisappear(animated)
|
|
super.viewWillDisappear(animated)
|
|
|
|
+ PQNotification.removeObserver(self)
|
|
UIApplication.shared.isIdleTimerDisabled = false
|
|
UIApplication.shared.isIdleTimerDisabled = false
|
|
}
|
|
}
|
|
|
|
|