0

こんにちは友人、アプリケーションでビデオファイルを繰り返し再生したいのですが、次のコードを使用してビデオファイルを再生しました

NSString *tempurl = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Movie.m4v"];
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:tempurl]];
player.view.frame = CGRectMake(0, 0, 867, 1008);
player.scalingMode = MPMovieScalingModeFill;
[self.view addSubview:player.view];
[player play];

動画ファイルの再生終了を警告できる Delegate メソッドを用意できますか 事前にありがとうございます

4

1 に答える 1

3

プロパティ「repeatMode」を使用して、MPMovieRepeatModeOne に設定できます。

//Determines how the movie player repeats the playback of the movie.


@property(nonatomic) MPMovieRepeatMode repeatMode

//Discussion The default value of this property is MPMovieRepeatModeNone. 

   // For a list of available repeat modes, see “MPMovieRepeatMode.”

// Availability Available in iOS 3.2 and later.Declared In MPMoviePlayerController.h

NSString *tempurl = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Movie.m4v"];
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:tempurl]];

player.view.frame = CGRectMake(0, 0, 867, 1008);

player.scalingMode = MPMovieScalingModeFill;

player.repeatMode = MPMovieRepeatModeOne;

[self.view addSubview:player.view];

[player play];
于 2011-03-14T10:46:27.480 に答える