I am able to fetch the output file URL like below using custom video recorder.
file:///var/mobile/Containers/Data/Application/5EB769B8-193F-4C9F-982A-48892333A8F0/Documents/2018-Oct-31%2012:16:54output.mov
I need to play that video using AVPlayerViewController. I am using the below code for playing video in my viewcontroller. But it is not working. Could anyone guide me to do this task?
func pathVideo()
{
if let path = Bundle.main.path(forResource: "file:///var/mobile/Containers/Data/Application/5EB769B8-193F-4C9F-982A-48892333A8F0/Documents/2018-Oct-31%2012:16:54output.mov", ofType: "mov", inDirectory: "file:///var/mobile/Containers/Data/Application/5EB769B8-193F-4C9F-982A-48892333A8F0/Documents/2018-Oct-31%2012:16:54output.mov")
{
let video = AVPlayer(url: URL(fileURLWithPath: path))
let playerViewController = AVPlayerViewController()
playerViewController.player = video
present(playerViewController, animated: true, completion:
{
video.play()
})
}
}