Pārlūkot izejas kodu

1,传发布时使用的模式参数

jsonwang 3 gadi atpakaļ
vecāks
revīzija
e47d47abb3

+ 8 - 7
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointEditerController.swift

@@ -6,11 +6,11 @@
 //  Copyright © 2021 BytesFlow. All rights reserved.
 //  功能:卡点音乐编辑界面
 
-// 创建不同玩法的类型
-enum createStickersModel {
-    case createStickersModelPoint // 卡点
-    case createStickersModelSpeed // 快慢速
-    case createStickersModelOnlyMusic //仅配乐
+// 创建不同玩法的类型 (1:跳跃卡点,2:快慢速,3:仅配乐)
+public enum createStickersModel: Int{
+    case createStickersModelPoint = 1 // 跳跃卡点
+    case createStickersModelSpeed = 2 // 快慢速
+    case createStickersModelOnlyMusic  = 3// 仅配乐
 }
 
 import Foundation
@@ -684,6 +684,7 @@ class PQStuckPointEditerController: PQBaseViewController {
         BFLog(message: "去发布")
         playerView.pause()
         let videoExporter = PQStuckPointPublicController()
+        videoExporter.rhythmMode = currentCreateStickersModel
         videoExporter.isReCreate = isReCreate
         videoExporter.selectedTotalDuration = selectedTotalDuration
         videoExporter.selectedDataCount = selectedDataCount
@@ -1154,8 +1155,8 @@ extension PQStuckPointEditerController {
                 if section.sectionType == "normal" {
 
                     BFLog(message: "stuckPoints count is \(stuckPoints.count)")
-                    //已经计算过所有贴纸的累计时长
-                    var totalStickerTimer:Float64 = 0
+                    //已经计算过所有贴纸的累计时长,起点是推荐时长或用户划动后的时间
+                    var totalStickerTimer:Float64 = CMTimeGetSeconds(playeTimeRange.start)
                     for sticker in section.sectionTimeline!.visionTrack!.getEnableVisionTrackMaterials() {
                         if sticker.type == StickerType.VIDEO.rawValue {
                             let asset: AVURLAsset = AVURLAsset(url: URL(fileURLWithPath: documensDirectory + sticker.locationPath), options: nil)