开发者

I Want the Video file to Play repeatedly in my application an I am using the MPMoviePlayerController to play the video file

HI Friends, I Want the Video File To Play repeatedly in my application开发者_StackOverflow and i have used the Following code to play the video file

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];

Can I Have The Delegate method that can give the alert for the video file end playing Thank You In Advance


you can use the property "repeatMode" and set it to 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];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜