我只想要一個連續循環的視頻。我設置了播放器這樣的:MPMoviePlayerController循環的問題
self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:someURL];
self.moviePlayer.controlStyle = MPMovieControlStyleNone;
self.moviePlayer.shouldAutoplay = YES;
self.moviePlayer.repeatMode = MPMovieRepeatModeOne;
self.moviePlayer.view.frame = self.container.frame;
[self.container addSubview:self.moviePlayer.view];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(moviePlayBackDidFinish:) name: MPMoviePlayerPlaybackStateDidChangeNotification
object: self.moviePlayer];
- (void) moviePlayBackDidFinish:(NSNotification*)notification {
NSLog(@"myMovieFinishedCallback: %@", notification);
MPMoviePlayerController *movieController = notification.object;
NSLog(@"player.playbackState = %d", movieController.playbackState);
}
的通知方法是一個簡單的黑客工具,有人建議在這裏:Smooth video looping in iOS
我有兩個問題。視頻循環仍然不是無縫的。循環之間有一個非常明顯的暫停。其次,視頻在任意數量的循環之後停止循環。通常在2-4個循環之間變化。這顯然是我的應用程序的一個巨大問題。玩家真的是這個馬車還是我做錯了什麼?
是的,我相信這個播放器非常麻煩(特別是在播放開始的時候)。也就是說,你可能想在你鏈接的問題中嘗試@cmatsumoto的回答。 – 2012-07-20 13:02:17