Skip to content

Instantly share code, notes, and snippets.

@OneSadCookie
Created October 25, 2011 16:20
Show Gist options
  • Save OneSadCookie/1313328 to your computer and use it in GitHub Desktop.
Save OneSadCookie/1313328 to your computer and use it in GitHub Desktop.
- (void)setSeekTime:(int)inSeconds frame:(int)inFrame {
if (self.videoTrack) {
float fps = [self.videoTrack nominalFrameRate];
[self.playerItem seekToTime:CMTimeMake(inSeconds + inFrame / fps, 1)];
// or: [self.playerItem seekToTime:CMTimeMake(inSeconds * fps + inFrame, fps)];
} else {
[self.playerItem seekToTime:CMTimeMakeWithSeconds(inSeconds, 1)];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment