現在、アプリの起動時に gif から変換された mp4 ビデオを再生していますが、ビデオを使用すると音楽の再生が停止し、Airplay デバイスが接続されていると問題が発生します。
とにかく、私が本当に欲しいのは、アプリの起動時にgifを表示することです. しかし、GIF を「再生」するようには見えません。1 つのフレームしか表示されません。GIF 全体を再生するにはどうすればよいですか?
私の現在のコード:
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// Show Animation;
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Launch" ofType:@"mp4"]];
LaunchPlayer = [[MPMoviePlayerViewController alloc]
initWithContentURL:url];
LaunchPlayer.view.frame = self.view.bounds;
LaunchPlayer.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
LaunchPlayer.moviePlayer.controlStyle = MPMovieControlStyleNone;
LaunchPlayer.view.tag = 1;
[self.view addSubview:LaunchPlayer.view];
[LaunchPlayer.moviePlayer play];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(LaunchFinish)
name:@"MPMoviePlayerPlaybackDidFinishNotification"
object:nil];
}