Problems using an NSMovieView -- what am I doing wrong?
Problems using an NSMovieView -- what am I doing wrong?
- Subject: Problems using an NSMovieView -- what am I doing wrong?
- From: "Tamara L. Cravit" <email@hidden>
- Date: Tue, 5 Nov 2002 14:32:10 -0800
Hi all,
Thanks to the recommendations of those on the list about Aaron Hillegass's
book, my first Cocoa application is coming along nicely (and I actually sort
of have my head around the Cocoa development paradigm, even.) Now, I've run
into a (I hope) small but pivotal snag, and I'm hoping someone can point me
in the right direction.
I'm trying to play a QuickTime movie from a CD-ROM inside my application,
and it's not working. I have an NSMovieView in my interface, and have
connected it to an IBOutlet in my code. Here's what I'm doing in my code:
- (IBAction) playMovie: (id) sender
{
NSMovie *movie;
NSURL *url;
NSString *urlString;
...
// CDVolumeName and MovieFilePath are defined outside of this section of
code.
urlString = [NSString stringWithFormat: @"/Volumes/%@/%@", CDVolumeName,
MovieFilePath];
url = [NSURL fileURLWithPath: urlString];
// If I NSLog the value of URL here, I get something like
// file://localhost/Volumes/MyCDName/data/movies/my_movie.mov
// which is correct, as far as I can tell.
movie = [[NSMovie alloc] initWithURL: url byReference: YES];
// At this point, movie is nil and my app blows up.
[MyMovieView setMovie: movie];
[MyMovieView setPlaysEveryFrame: NO];
[MyMovieView setVolume: 1.0];
[MyMovieView showController: YES adjustingSize: YES];
[MyMovieView start: sender;
}
If anyone can point me in the right direction, I'd greatly appreciate it.
Also, is there a way to find out WHY something failed -- like, if movie is
nil, is there something I can call to get an error code back from
initWithURL:byReference: that will tell me why it failed?
Thanks in advance!
Tamara, who's really grooving on Cocoa in spite of ripping her hair out :-)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.