How to detect AVPlayer actually started to play in swift : <p>Hello I have set my <code>UISlider</code>minimum value to 0.00. Then I set it's max value in this way.</p>

<pre><code>self.viewPlayer.layer.addSublayer(playerLayer)
    let duration : CMTime = avPlayer.avPlayer.currentItem!.asset.duration
    let seconds : Float64 = CMTimeGetSeconds(duration)

    sliderBar.maximumValue=Float(seconds)
    sliderBar!.isContinuous = false
    sliderBar!.tintColor = UIColor.green
</code></pre>

<p>But I am  getting this exception </p>

<pre><code>*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempting to set a slider's minimumValue (0.000000) to be larger than the maximumValue (nan)'
enter code here
</code></pre>

<p>I know after <code>prepareForPlay()</code> to actual playing it takes some time to really play the video. So how can I detect when the player really started to play the video?
Please help me.
Thanks</p>
