|
@@ -78,10 +78,7 @@ class PQStuckPointPublicController: PQBaseViewController {
|
|
|
private var endMovieLocalURL: URL? // 导出的地址
|
|
|
// 保存相册的合成视频地址 水印+片尾
|
|
|
private var saveMovieLocalURL: URL?
|
|
|
- //用户名绘制用到的参数
|
|
|
- private var userNameTop:Int = 0
|
|
|
- private var userNameFontSize:Int = 0
|
|
|
- private var userNameSize: CGRect = .zero
|
|
|
+
|
|
|
//----------------------------
|
|
|
|
|
|
// 预览大小
|
|
@@ -586,16 +583,7 @@ class PQStuckPointPublicController: PQBaseViewController {
|
|
|
|
|
|
// 取推荐标题
|
|
|
getTitles()
|
|
|
-
|
|
|
- //片尾用户名到顶部的高度
|
|
|
- userNameTop = Int(870 * (editProjectModel?.sData?.videoMetaData?.videoHeight ?? 0) / 1920)
|
|
|
- userNameFontSize = Int(100 * (editProjectModel?.sData?.videoMetaData?.videoWidth ?? 0) / 1080)
|
|
|
- if((editProjectModel?.sData?.videoMetaData?.videoHeight ?? 0) <= (editProjectModel?.sData?.videoMetaData?.videoWidth ?? 0)){
|
|
|
- userNameTop = 480
|
|
|
- userNameFontSize = 70
|
|
|
- }
|
|
|
- //片尾用户名绘制大小
|
|
|
- userNameSize = BFLoginUserInfo.shared.nickName.boundingRect(with: CGSize(width: userNameFontSize * 12, height: 0), options: .usesLineFragmentOrigin, attributes: [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: CGFloat(100 * (editProjectModel?.sData?.videoMetaData?.videoWidth ?? 0) / 1080)), NSAttributedString.Key.kern: 0 ], context: nil)
|
|
|
+
|
|
|
}
|
|
|
|
|
|
override func viewWillAppear(_ animated: Bool) {
|
|
@@ -638,6 +626,13 @@ class PQStuckPointPublicController: PQBaseViewController {
|
|
|
if exporter != nil {
|
|
|
exporter.cancel()
|
|
|
}
|
|
|
+ if watermarkMovieExporter != nil{
|
|
|
+ watermarkMovieExporter.cancel()
|
|
|
+ }
|
|
|
+ if endMovieExporter != nil{
|
|
|
+ endMovieExporter.cancel()
|
|
|
+ }
|
|
|
+
|
|
|
avPlayer.pause()
|
|
|
avPlayer.replaceCurrentItem(with: nil)
|
|
|
// 点击上报:返回按钮
|
|
@@ -1227,9 +1222,7 @@ extension PQStuckPointPublicController {
|
|
|
cShowHUB(superView: nil, msg: "视频发布失败,请重新合成")
|
|
|
} else {
|
|
|
bottomOprationBgView.isHidden = false
|
|
|
-
|
|
|
- //开始导出片尾 成功后自动保存到相册
|
|
|
- beginExportEndMovie()
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1607,6 +1600,9 @@ extension PQStuckPointPublicController {
|
|
|
}
|
|
|
|
|
|
self?.watermarkMovieLocalURL = url
|
|
|
+
|
|
|
+ //开始导出片尾 成功后自动保存到相册
|
|
|
+ self?.beginExportEndMovie()
|
|
|
|
|
|
|
|
|
}
|
|
@@ -1699,17 +1695,24 @@ extension PQStuckPointPublicController {
|
|
|
userNameSticker.timelineIn = bgMovieInfo.timelineIn
|
|
|
userNameSticker.timelineOut = bgMovieInfo.timelineOut
|
|
|
userNameSticker.type = StickerType.SUBTITLE.rawValue
|
|
|
+
|
|
|
+ //用户名绘制用到的参数
|
|
|
+ var userNameTop = Int(870 * (self?.editProjectModel?.sData?.videoMetaData?.videoHeight ?? 0) / 1920)
|
|
|
+ var userNameFontSize = Int(100 * (self?.editProjectModel?.sData?.videoMetaData?.videoWidth ?? 0) / 1080)
|
|
|
+ if((self?.editProjectModel?.sData?.videoMetaData?.videoHeight ?? 0) <= (self?.editProjectModel?.sData?.videoMetaData?.videoWidth ?? 0)){
|
|
|
+ userNameTop = 480
|
|
|
+ userNameFontSize = 70
|
|
|
+ }
|
|
|
let subtitleInfo:PQEditSubtitleInfoModel = PQEditSubtitleInfoModel.init()
|
|
|
- subtitleInfo.fontSize = self?.userNameFontSize ?? 0
|
|
|
+ subtitleInfo.fontSize = userNameFontSize
|
|
|
subtitleInfo.text = BFLoginUserInfo.shared.nickName
|
|
|
userNameSticker.subtitleInfo = subtitleInfo
|
|
|
|
|
|
-
|
|
|
let userNamePostion:PQEditMaterialPositionModel = PQEditMaterialPositionModel.init()
|
|
|
- userNamePostion.width = Int(self?.userNameSize.width ?? 0)
|
|
|
- userNamePostion.height = Int(self?.userNameSize.height ?? 0)
|
|
|
- userNamePostion.x = ((self?.editProjectModel?.sData?.videoMetaData?.videoWidth ?? 0) - Int(self?.userNameSize.width ?? 0)) / 2
|
|
|
- userNamePostion.y = self?.userNameTop ?? 0
|
|
|
+ userNamePostion.width = Int(userNameFontSize ) * 10
|
|
|
+ userNamePostion.height = Int(userNameFontSize ) * 3
|
|
|
+ userNamePostion.x = ((self?.editProjectModel?.sData?.videoMetaData?.videoWidth ?? 0) - userNamePostion.width) / 2
|
|
|
+ userNamePostion.y = userNameTop
|
|
|
userNameSticker.materialPosition = userNamePostion
|
|
|
|
|
|
//4,音频
|