Gov*_*iya 5 iphone video video-recording ios swift
在我的应用程序中,我正在 AVView 中播放视频,现在我正在该视图中按视图进行一些转换,现在我想将该视图录制为视频,我也需要音频,那么我该怎么做?
我尝试过这个库,但它多次卡住视频
https://github.com/wess/Glimpse
我做了足够的研发,但我没有得到任何可能的解决方案。
这是我的代码:
{
guard let path = Bundle.main.path(forResource: "video2", ofType: "mov") else {
return
}
let videoURL = NSURL(fileURLWithPath: path)
// Create an AVPlayer, passing it the local video url path
let player = AVPlayer(url: videoURL as URL)
let controller = AVPlayerViewController()
controller.player = player
present(controller, animated: true) {
player.play()
self.createImageView()
controller.view.addSubview(self.viewForImage)
self.zoomAnimationCount = 0
self.zoomInAnimation()
DispatchQueue.main.async {
self.glimpse!.startRecording(controller.view, onCompletion: { fileOuputURL in
print("DONE WITH OUTPUT: \(fileOuputURL?.absoluteString ?? "")")
})
DispatchQueue.main.asyncAfter(deadline: .now() + 20.0, execute: {
self.glimpse!.stop()
})
}
}
}
Run Code Online (Sandbox Code Playgroud)
请让我知道我该怎么做?
| 归档时间: |
|
| 查看次数: |
1137 次 |
| 最近记录: |