私はスワイプベースのアプリケーションを開発中です。各スワイプでは、他のアセットを含む動画を含むページが表示されます。私は各スワイプで私のためにこれを行うには、次のコードを使用しています。iPadビデオの読み込み問題
NSArray * file = [videoFile componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@ "。"]];
NSString *moviePath = [[NSBundle mainBundle] pathForResource:[file objectAtIndex:0] ofType:[file objectAtIndex:1]];
if (moviePath != nil)
{
//self.videoTimer = [NSTimer scheduledTimerWithTimeInterval:delayTime target:self selector:@selector(playVideo:) userInfo:nil repeats:NO];
self.theMovie = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:moviePath]];
self.theMovie.view.frame = self.bounds;
self.theMovie.moviePlayer.scalingMode = MPMovieScalingModeAspectFit;
self.theMovie.moviePlayer.controlStyle = MPMovieControlStyleNone;
self.theMovie.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
[self addSubview:self.theMovie.view];
[self.theMovie release];
}
else
{
[AssetValidator alertMissingFileInfo:videoFile];
}
これは問題なく動作します。
私の問題は、ビデオをスワイプするたびに、遅延と黒い画面が始まるということです。
この問題を解決する方法を教えてください。
よろしくお願いいたします。
ありがとうございました。約2MB。ただし、ページ数は300にすることができます。動画をメモリに保存する方法を教えてください。 – TechBee
うわー!それからメモリに600メガバイトになるでしょう - 少し "あまりにも!"私はそこに解決策はないと思う。ムービーが毎回読み込まれると、遅延が残ります。 – Knodel