TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Feb 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by nakajijapan.
NKJMovieComposer is very simple movie composer for iOS.
NKJMovieComposer higher requires Xcode 6, targeting either iOS 8.0 and above, or Mac OS 10.10 OS X and above.
let movieComposition = NKJMovieComposer()
Append Movies.
// movie
let movieURL = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("movie001", ofType: "mov"))
layerInstruction = movieComposition.addVideo(movieURL)
// compose
self.assetExportSession = movieComposition.readyToComposeVideo(composedMoviePath)
let composedMovieUrl = NSURL.fileURLWithPath(composedMoviePath)
// export
self.assetExportSession.exportAsynchronouslyWithCompletionHandler({() -> Void in
// save to device
var library = ALAssetsLibrary()
if library.videoAtPathIsCompatibleWithSavedPhotosAlbum(composedMovieUrl) {
library.writeVideoAtPathToSavedPhotosAlbum(composedMovieUrl, completionBlock: {(assetURL, assetError) -> Void in
// something code
})
}
})
nakajijapan
NKJMovieComposer is available under the MIT license. See the LICENSE file for more info.