Current time using avplayer returns wrong values and same values ios

1.1k views Asked by At

I want to get current time of video playing using avplayer. I have used following code:-

let currentItem:AVPlayerItem = player!.currentItem
var currentTime:NSTimeInterval = CMTimeGetSeconds(currentItem.currentTime())
println(currentTime)

This returns sometimes correct value i.e. proper time duration and sometimes stops at some value and does not give proper value. What can be reason behind this? Please help me to resolve this issue.

Thanks in advance.

0

There are 0 answers