Reputation: 38213
I want to know how far the video had progressed when the user closes the video.
So for I have this:
- (void) moviePlayerDidFinsh:(NSNotification*) notification
{
MPMoviePlayerController* moviePlayer = notification.object;
NSLog(@"FINISHED duration was:%f", moviePlayer.duration);
}
initialPlaybackTime
and endPlaybackTime
both seam to be useless.
Upvotes: 0
Views: 1120
Reputation: 29767
There is a property currentPlaybackTime
in MPMediaPlayback protocol.
The current position of the playhead. (required)
@property(nonatomic) NSTimeInterval currentPlaybackTime
% value = currentPlaybackTime/duration;
Upvotes: 3
Reputation: 35384
The property is currentPlaybackTime
(in seconds).
This is only useful if the MPMovieFinishReason
is equal to MPMovieFinishReasonUserExited
.
NSDictionary* userInfo = [aNotification userInfo];
MPMovieFinishReason finishReason = [[userInfo objectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey] intValue];
if (finishReason == MPMovieFinishReasonUserExited) {
NSTimeInterval playbackTime = [moviePlayer currentPlaybackTime];
// ...
}
Upvotes: 1