Use the currentTimeand properties duration.
i.e. skip ahead
NSTimeInterval time = avPlayer.currentTime;
time += 5.0; // forward 5 secs
if (time > avPLayer.duration)
{
// stop, track skip or whatever you want
}
else
avPLayer.currentTime = time;
Similarly, to go back, compare currentTimewith 0insteadduration
source
share