Skip to content

Commit

Permalink
Add grid merge method
Browse files Browse the repository at this point in the history
  • Loading branch information
Datt1994 committed May 14, 2020
1 parent b2d9d8f commit 4b02625
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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()
})
})
```

0 comments on commit 4b02625

Please sign in to comment.