Overlay alpha channel video animation player view using OpenGLES.
To run the example project, clone the repo, and run pod install from the Example directory first.
At the top of your file, make sure to import Kitsunebi
import Kitsunebi
Then, instantiate KBAnimationView in your view controller:
private lazy var playerView: KBAnimationView = KBAnimationView(frame: view.bounds)!
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(playerView)
}
You can play transparency video any framerate. mainVideo is colornize video, alphaVideo is alpha channel monotone video. please see example video files.:
playerView.play(mainVideoURL: Bundle.main.url(forResource: "main", withExtension: "mp4")!,
alphaVideoURL: Bundle.main.url(forResource: "alpha", withExtension: "mp4")!,
fps: 30)
If video playing are slow, change quality.
playerView.quality = .low
Kitsunebi is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Kitsunebi'
Tomoya Hirano, noppelabs@gmail.com
Kitsunebi is available under the MIT license. See the LICENSE file for more info.