QTMovie not playing in new window
QTMovie not playing in new window
- Subject: QTMovie not playing in new window
- From: Paolo Franzetti <email@hidden>
- Date: Mon, 04 Jul 2011 11:21:02 +0200
I have a MAC OSX application in which I would like to press a button in
the main window and open a new window in which a movie is played. This
is my IBAction code;
Code:
- (IBAction) playButtonClicked: (id) sender
{
MoviePlayerController *moviePlayerWindow = [[MoviePlayerController alloc] initWithWindowNibName:@"MoviePlayer"];
[moviePlayerWindow showWindow:self];
NSError *error;
NSString *moviePath = [[NSBundle mainBundle] pathForResource:@"sample_iTunes" ofType:@"mov"];
QTMovie *movie = [QTMovie movieWithFile:moviePath error:&error];
if (error) {
NSLog(@"%@", [error localizedDescription]);
} else {
[movie gotoBeginning];
[moviePlayerWindow.movieViewer setMovie:movie];
[moviePlayerWindow.movieViewer play:nil];
}
}
movieViewer is a QTMovieViewer outlet inside the new window.
The window opens but no movie is played; can someone understand what I
am doing wrong ? I can send the complete project (it is a test one, very
small) if needed.
Thank you very much for any help.
Paolo
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden