Kaynağa Gözat

去除警告

zhongbaojian 5 yıl önce
ebeveyn
işleme
1ae69a9626

+ 5 - 5
SuperShow.xcodeproj/project.pbxproj

@@ -2868,8 +2868,8 @@
 			isa = PBXGroup;
 			children = (
 				A8CA0A4A227157CF007E7584 /* IJKMediaFramework.framework */,
-				A8CA0A4E227157CF007E7584 /* IJKMediaFrameworkTests.xctest */,
 				A8CA0A4C227157CF007E7584 /* IJKMediaFrameworkWithSSL.framework */,
+				A8CA0A4E227157CF007E7584 /* IJKMediaFrameworkTests.xctest */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -3857,7 +3857,7 @@
 				CODE_SIGN_ENTITLEMENTS = SuperShow/SuperShow.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1117;
+				CURRENT_PROJECT_VERSION = 1118;
 				DEVELOPMENT_TEAM = 6DTLD5LADX;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -4020,7 +4020,7 @@
 				CODE_SIGN_ENTITLEMENTS = SuperShow/SuperShow.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1117;
+				CURRENT_PROJECT_VERSION = 1118;
 				DEVELOPMENT_TEAM = 6DTLD5LADX;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -4238,7 +4238,7 @@
 				CODE_SIGN_ENTITLEMENTS = SuperShow/SuperShow.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1117;
+				CURRENT_PROJECT_VERSION = 1118;
 				DEVELOPMENT_TEAM = 6DTLD5LADX;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -4462,7 +4462,7 @@
 				CODE_SIGN_ENTITLEMENTS = SuperShow/SuperShow.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1117;
+				CURRENT_PROJECT_VERSION = 1118;
 				DEVELOPMENT_TEAM = 6DTLD5LADX;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (

+ 1 - 1
SuperShow/Tool/WSSCommonExtension.swift

@@ -61,7 +61,7 @@ class WSSCommonExtension: NSObject {
                 let watermarkSize = CGSize(width: 35 * scale, height: 35 * scale)
 
                 WSSHub.showHub("正在保存...")
-                try? WSSMediaOperationTool.insertWatermark(withVideoAsset: videoAsset, watermark: watermark, watermarkSize: watermarkSize, finish: { tmpUrl in
+                _ = try? WSSMediaOperationTool.insertWatermark(withVideoAsset: videoAsset, watermark: watermark, watermarkSize: watermarkSize, finish: { tmpUrl in
 
                     if let finishUrl = tmpUrl {
                         self.saveToAlbume(withFileUrl: finishUrl)

+ 9 - 4
SuperShow/Tool/WSSMediaOperationTool.swift

@@ -68,9 +68,7 @@ class WSSMediaOperationTool: NSObject {
     }
 
     func endImage2Video() {
-        if let imagedecoder = imageVideoDecoder {
-            imageVideoDecoder?.endProgressing()
-        }
+        imageVideoDecoder?.endProgressing()
     }
 
     func releaseObjs() {
@@ -443,7 +441,7 @@ extension WSSMediaOperationTool {
         } else if _audioVolume > 1.0 {
             _audioVolume = 1.0
         }
-        
+
         /// 目前先注释掉,目前可以调节原生与配乐都为0.0
 //        if _audioVolume == 0.0 {
 //            // 如果需要混入的音频音量为0,即表示不混音,直接返回原视频资源
@@ -965,6 +963,13 @@ extension WSSMediaOperationTool {
         }
     }
 
+    /// 视频插入水印
+    /// - Parameters:
+    ///   - videoAsset: 需要插入水印的视频
+    ///   - watermark: 水印
+    ///   - watermarkSize: 水印大小
+    ///   - finish: 完成回调
+    @discardableResult
     class func insertWatermark(withVideoAsset videoAsset: AVAsset, watermark: UIImage, watermarkSize: CGSize, finish: @escaping (URL?) -> Void) throws -> AVAssetExportSession? {
         do {
             guard videoAsset.tracks(withMediaType: AVMediaType.video).count > 0 else {

+ 1 - 1
SuperShow/Tool/WSSRecordTool.swift

@@ -114,7 +114,7 @@ class WSSRecordTool: NSObject {
         if let url = self.audioRecorder?.url {
             let audioAsset = AVURLAsset(url: url)
             let exportUrl = URL(fileURLWithPath: exportPath())
-            WSSMediaOperationTool.exportAudio(withAudioAsset: audioAsset, exportPath: exportUrl) { [weak self] flag in
+            _ = WSSMediaOperationTool.exportAudio(withAudioAsset: audioAsset, exportPath: exportUrl) { [weak self] flag in
                 WSSLog("导出成功:\(flag)")
                 if flag {
                     self?.finishRecordHandle?(exportUrl)

+ 2 - 2
SuperShow/UI/CoolDance/Views/WSSControlMusicView.swift

@@ -157,7 +157,7 @@ class WSSControlMusicView: UIView {
                 let path = kOJSUserDocumentDirectory + "/" + "tmp_cut_music.m4a"
                 let url = URL(fileURLWithPath: path)
                 try? kOJSFileManager.removeItem(at: url)
-                WSSMediaOperationTool.exportAudio(withAudioAsset: result, exportPath: url) { isSuccess in
+                _ = WSSMediaOperationTool.exportAudio(withAudioAsset: result, exportPath: url) { isSuccess in
                     DispatchQueue.main.async {
                         if isSuccess {
                             finish(url)
@@ -543,7 +543,7 @@ class WSSControlMusicView: UIView {
                 let path = kOJSUserDocumentDirectory + "/" + "tmp_cut_music.m4a"
                 let url = URL(fileURLWithPath: path)
                 try? kOJSFileManager.removeItem(at: url)
-                WSSMediaOperationTool.exportAudio(withAudioAsset: result, exportPath: url) { [weak self] isSuccess in
+                _ = WSSMediaOperationTool.exportAudio(withAudioAsset: result, exportPath: url) { [weak self] isSuccess in
 
                     DispatchQueue.main.async {
                         if isSuccess {