To get the living position of the poison and look for it, you can use seekableTimeRangesof AVPlayerItem:
CMTimeRange seekableRange = [player.currentItem.seekableTimeRanges.lastObject CMTimeRangeValue];
CGFloat seekableStart = CMTimeGetSeconds(seekableRange.start);
CGFloat seekableDuration = CMTimeGetSeconds(seekableRange.duration);
CGFloat livePosition = seekableStart + seekableDuration;
[player seekToTime:CMTimeMake(livePosition, 1)];
Also, when you search some time ago, you can get the current playback position by calling the method currentTime
CGFloat current = CMTimeGetSeconds([self.player.currentItem currentTime]);
GCFloat diff = livePosition - current;
source
share