Reputation: 347
I'm playing video using MPMoviePlayerController and I need to play it starting from a given point by this code:
MPMoviePlayerController *player;
[player setCurrentPlaybackTime:from];
[player setInitialPlaybackTime:from];
[player setEndPlaybackTime:to];
[player prepareToPlay];
[player play];
But it doesn't work, the video always plays from beginning. I've seen on Apple Docs that initialPlaybackTime is deprecated in iOS 9 (as well as endPlaybackTime). Does it mean than it will not work on iOS 9? I tried to run this code on iOS 8.4, but the result is the same: the video always plays from the very beginning.
How to make it play from a given point?
Thank you!
Upvotes: 2
Views: 887
Reputation: 555
Use AVPlayer instead of MPMoviePlayer. It will give you more control over Media playback.
Upvotes: 1