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.