|
@@ -511,6 +511,10 @@ class PQStuckPointPublicController: PQBaseViewController {
|
|
|
PQNotification.addObserver(self, selector: #selector(enterBackground), name: UIApplication.didEnterBackgroundNotification, object: nil)
|
|
|
PQNotification.addObserver(self, selector: #selector(willEnterForeground), name: UIApplication.willEnterForegroundNotification, object: nil)
|
|
|
UIApplication.shared.isIdleTimerDisabled = true
|
|
|
+
|
|
|
+
|
|
|
+ //从相册选择一个照片后回调
|
|
|
+ addNotification(self, selector: #selector(imageSelectedImage(notify:)), name: cSelectedImageSuccessKey, object: nil)
|
|
|
|
|
|
#if swift(>=4.2)
|
|
|
let memoryNotification = UIApplication.didReceiveMemoryWarningNotification
|
|
@@ -534,7 +538,6 @@ class PQStuckPointPublicController: PQBaseViewController {
|
|
|
override func viewWillDisappear(_ animated: Bool) {
|
|
|
super.viewWillDisappear(animated)
|
|
|
UIApplication.shared.isIdleTimerDisabled = false
|
|
|
- PQNotification.removeObserver(self)
|
|
|
}
|
|
|
|
|
|
deinit {
|
|
@@ -1172,12 +1175,24 @@ extension PQStuckPointPublicController {
|
|
|
|
|
|
publicEditCoverView.show(videoURL: exportLocalURL!, duration: CMTimeGetSeconds(asset.duration))
|
|
|
|
|
|
+ //点击了确认 btn
|
|
|
publicEditCoverView.selectImageCallBack = { [weak self] imageData in
|
|
|
|
|
|
self?.coverImageView.image = imageData
|
|
|
self?.uploadData?.image = imageData
|
|
|
self?.updateCoverImagegOrTitle()
|
|
|
}
|
|
|
+ //点击了从相册选择
|
|
|
+ publicEditCoverView.selectPhotoBtnCallBack = { [weak self] in
|
|
|
+ let imageSelected = PQImageSelectedController()
|
|
|
+ imageSelected.isAssetImage = true
|
|
|
+
|
|
|
+ imageSelected.videoWidth = CGFloat(self?.editProjectModel?.sData?.videoMetaData?.videoWidth ?? 0)
|
|
|
+ imageSelected.videoHeight = CGFloat(self?.editProjectModel?.sData?.videoMetaData?.videoHeight ?? 0)
|
|
|
+// imageSelected.uploadData = uploadData
|
|
|
+ // imageSelected.updataVideoData = updataVideoData
|
|
|
+ self?.navigationController?.pushViewController(imageSelected, animated: true)
|
|
|
+ }
|
|
|
|
|
|
PQEventTrackViewModel.baseReportUpload(businessType: .bt_buttonClick, objectType: .ot_weapp_musicVideoCreate_post_changeCover, pageSource: .sp_user_music_videos_create_post, extParams: ["videoId":videoData?.uniqueId ?? ""], remindmsg: "")
|
|
|
|
|
@@ -1255,4 +1270,16 @@ extension PQStuckPointPublicController {
|
|
|
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ @objc func imageSelectedImage(notify: Notification) {
|
|
|
+ let imageData: UIImage? = notify.userInfo?["image"] as? UIImage
|
|
|
+ if imageData != nil {
|
|
|
+ BFLog(message: "从系统相册选择了一个照片")
|
|
|
+ publicEditCoverView.isHidden = true
|
|
|
+ coverImageView.image = imageData
|
|
|
+ uploadData?.image = imageData
|
|
|
+ updateCoverImagegOrTitle()
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|