• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: QTMovie not playing in new window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QTMovie not playing in new window


  • Subject: Re: QTMovie not playing in new window
  • From: Kyle Sluder <email@hidden>
  • Date: Tue, 05 Jul 2011 22:12:41 -0700

On Mon, Jul 4, 2011 at 2:21 AM, Paolo Franzetti <email@hidden> wrote:
> - (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.

Have you made sure this outlet is connected?

This also violates good principles of encapsulation. It would be
better to subclass NSWindowController and provide a custom
initializer, like this:

@interface MoviePlayerWindowController : NSWindowController

- (id)initWithMovie:(QTMovie *)aMovie

@end

--Kyle Sluder
_______________________________________________

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

References: 
 >QTMovie not playing in new window (From: Paolo Franzetti <email@hidden>)

  • Prev by Date: Delay in reading cookie using NSHttpCookieStorage
  • Next by Date: Re: NSDatePicker weirdness with time.
  • Previous by thread: QTMovie not playing in new window
  • Next by thread: Re: QTMovie not playing in new window
  • Index(es):
    • Date
    • Thread