From 4b026252435ccca81bab8b326c6d57d5c405a924 Mon Sep 17 00:00:00 2001 From: Datt Date: Thu, 14 May 2020 15:43:33 +0530 Subject: [PATCH] Add grid merge method --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 12f60ac..490062e 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,8 @@ $ pod install if error != nil { let errorMessage = "Could not merge videos: \(error?.localizedDescription ?? "error")" let alert = UIAlertController(title: "Error", message: errorMessage, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { (a) in + })) self.present(alert, animated: true) {() -> Void in } return } @@ -58,4 +60,20 @@ $ pod install objAVPlayerVC.player?.play() }) }) + + DPVideoMerger().gridMergeVideos(withFileURLs: fileURLs, videoResolution: CGSize(width: 1000, height: 1000), completion: {(_ mergedVideoFile: URL?, _ error: Error?) -> Void in + if error != nil { + let errorMessage = "Could not merge videos: \(error?.localizedDescription ?? "error")" + let alert = UIAlertController(title: "Error", message: errorMessage, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { (a) in + })) + self.present(alert, animated: true) {() -> Void in } + return + } + let objAVPlayerVC = AVPlayerViewController() + objAVPlayerVC.player = AVPlayer(url: mergedVideoFile!) + self.present(objAVPlayerVC, animated: true, completion: {() -> Void in + objAVPlayerVC.player?.play() + }) + }) ```