Hello I have set my UISlider
minimum value to 0.00. Then I set it\'s max value in this way.
self.viewPlayer.layer.addSublayer(playerLayer)
le
Here is what I did to actually know when video started (not when it's only ready to start).
Swift 4
player = AVPlayer(url: URL(fileURLWithPath: path))
player.addObserver(self, forKeyPath: "rate", options: NSKeyValueObservingOptions.new, context: nil)
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
if keyPath == "rate" {
if player.rate > 0 {
print("video started")
}
}
}