I'm writing an app that needs to be able to play back all of the user's videos, including the Slo-Mo ones. My code works OK for normal videos, but the Slo-Mo videos are being played at normal speed (not slow motion). I've googled and searched SO but haven't been able to find any code examples to get this to work.
I get the asset url by doing the following:
PHVideoRequestOptions *options = [PHVideoRequestOptions new];
options.deliveryMode = PHVideoRequestOptionsDeliveryModeHighQualityFormat;
options.version = PHVideoRequestOptionsVersionOriginal;
[[PHImageManager defaultManager] requestAVAssetForVideo:asset options:options resultHandler:^(AVAsset *asset, AVAudioMix *audioMix, NSDictionary *info) {
if ([asset isKindOfClass:[AVURLAsset class]])
completion(((AVURLAsset *)asset).URL);
}];
I then pass the URL into the MPMoviePlayerController:
_moviePlayer.view.frame = self.view.frame;
_moviePlayer.allowsAirPlay = true;
_moviePlayer.shouldAutoplay = true;
_moviePlayer.movieSourceType = MPMovieSourceType.File;
_moviePlayer.scalingMode = MPMovieScalingMode.AspectFit;
_moviePlayer.controlStyle = MPMovieControlStyle.Default;
_moviePlayer.view.autoresizingMask = [UIViewAutoresizing.FlexibleHeight, UIViewAutoresizing.FlexibleWidth];
_moviePlayer.contentURL = url!;
_moviePlayer.prepareToPlay();
_moviePlayer.play();
Any help would be greatly appreciated.
Thanks
Jacob