I know this question was ask lot time but not get proper solution,
i have one m3u8 file which is not working in AVPlayer but if i use other m3u8 file which was already on internet that is working fine with AVPlayer ,here is my code
func playVideo() {
let videoURL = URL(string: "https://architectsummit.s3.us-east-2.amazonaws.com/hls/playlist-with-vtt.m3u8")
let player = AVPlayer(url: videoURL!)
var playerViewController = AVPlayerViewController()
playerViewController.player = player
DispatchQueue.main.async {
self.present(playerViewController, animated: true) {
playerViewController.player!.play()
}
}
}
in above code i used m3u8 file which provided by our developer , but if i use this url 'https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8' in above code video is playing what is issue anyone could help me.