iOS 7'de MPMoviePlayerController ile ilgili bir sorunla karşı karşıyayım. İleriye doğru arama düğmesine dokunulduğunda video durur ve tam ekran ve kaydırıcıyı değiştirmek gibi bir şey yapmaya izin vermez.MPMoviePlayerController ileriye doğru arama tuşu, videoyu IOS7'de mi durduruyor?
İşte kodum. Yeni Bildirim MPMoviePlayerPlaybackDidFinishNotification
İşte[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(videoFinished:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
MPMoviePlayerPlaybackDidFinishNotification
-(void)videoFinished:(NSNotification*)aNotification{
MPMoviePlayerController *moviePlayer = [aNotification object];
NSLog(@"%f",moviePlayer.currentPlaybackTime);
int reason = [[[aNotification userInfo] valueForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey] intValue];
if (reason == MPMovieFinishReasonPlaybackEnded) {
}else if (reason == MPMovieFinishReasonUserExited) {
[self performSelector:@selector(dismiss:) withObject:aNotification afterDelay:0.5];
}else if (reason == MPMovieFinishReasonPlaybackError) {
}
}
işlemek için benim özel yöntem olup
MPMoviePlayerPlaybackDidFinishNotification
[[NSNotificationCenter defaultCenter] removeObserver:moviePlayerViewController name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayerViewController.moviePlayer];
için Observer kaldırıp eklemek
Bu garip davranışı tek tıklamayla durdurmalı ve oynamaya devam etmeliyim.
Bunu nasıl yapacağını bilen var mı? Teşekkürler.