#import "PlayVideoViewController.h"
#import "MediaPlayer/MediaPlayer.h"
@implementation PlayVideoViewController
- (void)viewDidLoad
{
NSString *url = [[NSBundle mainBundle]
pathForResource:@"Miracle"
ofType:@"mp4"];
MPMoviePlayerController *player =
[[MPMoviePlayerController alloc]
initWithContentURL:[NSURL fileURLWithPath:url]];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(movieFinishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
//---play movie---
[player play];
// Changing the orientation
// [player setOrientation:UIDeviceOrientationPortrait animated:NO];
[super viewDidLoad];
}
- (void) movieFinishedCallback:(NSNotification*) aNotification {
MPMoviePlayerController *player = [aNotification object];
[[NSNotificationCenter defaultCenter]
removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
[player autorelease];
}
@end
Wednesday, July 7, 2010
Subscribe to:
Post Comments (Atom)
2 comments:
You r good! !! !!! !!!!
(wahid here)
Thankssss.......:)
but why this name...!!!???
Post a Comment