Latest | 1.0.0 |
---|---|
Homepage | https://github.com/Datt1994/DPVideoMerger-Swift |
License | Apache 2.0 |
Platforms | ios 9.0 |
Authors |
For Objective C :- DPVideoMerger
Installation with CocoaPods
CocoaPods is a dependency manager for Objective-C. You can install it with the following command:
$ gem install cocoapods
Podfile
To integrate DPVideoMerger into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target 'TargetName' do
pod 'DPVideoMerger-Swift'
end
Then, run the following command:
$ pod install
Add Manually
Download Project and copy-paste DPVideoMerger.swift
file into your project
Usage
import AVKit
let fileURL = Bundle.main.url(forResource: "1", withExtension: "mp4")
let fileURL1 = Bundle.main.url(forResource: "2", withExtension: "mp4")
let fileURL2 = Bundle.main.url(forResource: "3", withExtension: "MOV")
let fileURL3 = Bundle.main.url(forResource: "4", withExtension: "mp4")
let fileURLs = [fileURL, fileURL1, fileURL2, fileURL3]
DPVideoMerger().mergeVideos(withFileURLs: fileURLs as! [URL], 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)
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()
})
})
Latest podspec
{ "name": "DPVideoMerger-Swift", "version": "1.0.0", "summary": "Multiple videos merge in one video with manage scale and aspect ratio for Swift.", "homepage": "https://github.com/Datt1994/DPVideoMerger-Swift", "license": "Apache 2.0", "authors": { "Datt1994": "[email protected]" }, "platforms": { "ios": "9.0" }, "swift_version": "4.2", "source": { "git": "https://github.com/Datt1994/DPVideoMerger-Swift.git", "tag": "1.0.0", "commit": "bdcf67322ad2b9320e59defe043ffa0f6383aac0" }, "source_files": "DPVideoMerger/DPVideoMerger/DPVideoMerger.swift" }
Tue, 28 May 2019 10:21:07 +0000