I am working on the iOS application. This application base on the NEWS media.
I am playing the small video of highlighted News. I am facing a stranger problem with AVPlayerViewController
.
When i play the video everything is fine. When i go to offline the buffer video play perfect & after the play buffer video, the video stops but the progress bar(Slider)
continuously in play state while the video has been stopped.
For more clearance please watch this GIF image :
Please visit this link for batter understanding.
This is my code for player.
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.playVideo()
}
func playVideo(){
let videoURL = NSURL(string: "http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8")
let player = AVPlayer(URL: videoURL!)
let playerController = AVPlayerViewController()
playerController.player = player
self.addChildViewController(playerController)
self.view.addSubview(playerController.view)
playerController.view.frame = self.view.frame
player.play()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}