I have added a DemoVideo.mp4 in my project and added it to copy resource file. But when i run the app it doesn\'t play my video. Here is my method.
private func
let path : String = Bundle.main.path(forResource: "charlie", ofType: "mp4")!
let movieurl : URL = URL(fileURLWithPath: path)
let movie : AVPlayerViewController = AVPlayerViewController()
movie.view.frame = self.view.bounds
let player : AVPlayer = AVPlayer(url: movieurl)
movie.player = player
self.view.addSubview(movie.view)
player.play()