Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
format
  • Loading branch information
tarrinneal committed Apr 21, 2023
commit b78ae9be7e60d96d2e2c4462f481230071c7121c
Original file line number Diff line number Diff line change
Expand Up @@ -420,16 +420,16 @@ - (int64_t)duration {
}

- (void)seekTo:(int)location completionHandler:(void (^)(BOOL))completionHandler {
CMTime locationCMT = CMTimeMake(location, 1000);
CMTimeValue duration = _player.currentItem.asset.duration.value;
CMTimeValue locationCM = locationCMT.value;
if (duration == locationCM) {
[_player seekToTime:_player.currentItem.currentTime
toleranceBefore:CMTimeMake(1, 1000)
toleranceAfter:CMTimeMake(1, 1000)
completionHandler:completionHandler];
return;
}
CMTime locationCMT = CMTimeMake(location, 1000);
CMTimeValue duration = _player.currentItem.asset.duration.value;
CMTimeValue locationCM = locationCMT.value;
if (duration == locationCM) {
[_player seekToTime:_player.currentItem.currentTime
toleranceBefore:CMTimeMake(1, 1000)
toleranceAfter:CMTimeMake(1, 1000)
completionHandler:completionHandler];
return;
}
[_player seekToTime:locationCMT
toleranceBefore:kCMTimeZero
toleranceAfter:kCMTimeZero
Expand Down