私は実際にMPMoviePlayerController
iPadアプリで再生ビデオを使用しています。
実際には、1つのビデオを簡単に再生できますが、同時に2つのビデオを再生しようとしています。これが私のコードです:
// Look for the video in the main bundle
NSString *urlStr = [[NSBundle mainBundle] pathForResource:@"3idiots.mov" ofType:nil];
NSURL *url = [NSURL fileURLWithPath:urlStr];
NSString *urlStr2 = [[NSBundle mainBundle] pathForResource:@"3idiots.mov" ofType:nil];
NSURL *url2 = [NSURL fileURLWithPath:urlStr2];
videoPlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
[self.view addSubview:videoPlayer.view];
videoPlayer.view.frame = CGRectMake(0, 0,200, 200);
videoPlayer2 = [[MPMoviePlayerController alloc] initWithContentURL:url2];
[self.view addSubview:videoPlayer2.view];
videoPlayer2.view.frame = CGRectMake(0, 300,200, 200);
[videoPlayer2 play];
NSLog(@"Video 1 playing");
[videoPlayer play];
NSLog(@"Video 2 playing");
最初のビデオは正しく起動されますが、2 番目のビデオは正しく起動されません。(ところで、最初のビデオが終了した後、2番目のビデオは起動しません)
これが私の出力です:
2012-06-18 13:47:23.015 testMosaique[2498:11f03] Video 1 playing
2012-06-18 13:47:23.016 testMosaique[2498:11f03] Video 2 playing
MPMoviePlayerController
2 つ以上のビデオを同時に再生する方法はありますか?
ありがとう