Jarkid
Jarkid

Reputation: 181

MPMoviePlayerController, How to get the last playing second when clicking the stop button?

I am trying to get the last playing second when clicking the stop button and record that, so that users can continue to watch the film from the second that played last time by setting the InitialPlaybackTime when playing the video.

So how can I get the last playing second in MPMoviePlayerController?

Thanks a lot

Upvotes: 3

Views: 1733

Answers (1)

TechBee
TechBee

Reputation: 1941

Rather than keeping the video player in the memory, you can take an image of the last frame of the movie and attach it using the following code:

"mp" is instance of MPMoviePlayerController.

UIImageView *lastVideoFrame = [[[UIImageView alloc]init]autorelease];

lastVideoFrame.image = [mp thumbnailImageAtTime:[mp playableDuration] timeOption:MPMovieTimeOptionExact];

Regards.

Upvotes: 7

Related Questions