Skip to content

Commit 4b02625

Browse files
committed
Add grid merge method
1 parent b2d9d8f commit 4b02625

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ $ pod install
4949
if error != nil {
5050
let errorMessage = "Could not merge videos: \(error?.localizedDescription ?? "error")"
5151
let alert = UIAlertController(title: "Error", message: errorMessage, preferredStyle: .alert)
52+
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { (a) in
53+
}))
5254
self.present(alert, animated: true) {() -> Void in }
5355
return
5456
}
@@ -58,4 +60,20 @@ $ pod install
5860
objAVPlayerVC.player?.play()
5961
})
6062
})
63+
64+
DPVideoMerger().gridMergeVideos(withFileURLs: fileURLs, videoResolution: CGSize(width: 1000, height: 1000), completion: {(_ mergedVideoFile: URL?, _ error: Error?) -> Void in
65+
if error != nil {
66+
let errorMessage = "Could not merge videos: \(error?.localizedDescription ?? "error")"
67+
let alert = UIAlertController(title: "Error", message: errorMessage, preferredStyle: .alert)
68+
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { (a) in
69+
}))
70+
self.present(alert, animated: true) {() -> Void in }
71+
return
72+
}
73+
let objAVPlayerVC = AVPlayerViewController()
74+
objAVPlayerVC.player = AVPlayer(url: mergedVideoFile!)
75+
self.present(objAVPlayerVC, animated: true, completion: {() -> Void in
76+
objAVPlayerVC.player?.play()
77+
})
78+
})
6179
```

0 commit comments

Comments
 (0)