MPOS MoviePlayerController ios video controls do not show the correct time

I have the following code that I use to play the selected part of a movie clip. The film plays well. But the scrubber rod does not reflect the correct start stop time. In addition, the fast forward and rewind buttons take the clip out of the specified segment. Why can we fix this too?

TIA.

MPMoviePlayerViewController *mp =
[[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:movieFile] ];

[mp.moviePlayer setInitialPlaybackTime:21];
[mp.moviePlayer setEndPlaybackTime:48];

[self presentMoviePlayerViewControllerAnimated:mp];
[self shouldAutorotateToInterfaceOrientation:YES];
//NSLog(@"Movie Player Controller View = %@", mp.moviePlayer.view);
//NSLog(@"Movie Player Controller Parent View = %@", mp.parentViewController);

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(moviePlayBackDidFinish:)
                                             name:MPMoviePlayerPlaybackDidFinishNotification
                                           object:[mp moviePlayer]];

[mp.moviePlayer play];
+3
source share

Source: https://habr.com/ru/post/1769262/


All Articles