Re: quicktime movie inside an existing view?
Re: quicktime movie inside an existing view?
- Subject: Re: quicktime movie inside an existing view?
- From: Niall Dalton <email@hidden>
- Date: Mon, 3 Dec 2001 11:35:10 -0800 (PST)
On Mon, 3 Dec 2001, [ISO-8859-1] Stiphane Sudre wrote:
>
NSURL *movieUrl = [NSURL fileURLWithPath:filePath];
>
theMovie = [[NSMovie alloc] initWithURL:movieUrl byReference:YES];
>
theMovieView = [[NSMovieView alloc] initWithFrame: aRect];
>
[theMovieView setMovie: theMovie];
>
>
[[self get_view] addSubview: theMovieView];
>
>
// play the movieview
>
>
[theMovieView start: self];
>
>
and do your drawing as usual in your drawInRect method.
While moving that code into the loadForDrawInRect sorts out the infinite
loop, it only gets me a blank view. I have this working for static images
via NSImage (load in it loadForDrawInRect), and
- (void)drawInRect:(NSRect)aRect
{
NSImageRep *imagerep;
imagerep = [[theImage representations] objectAtIndex:0];
[imagerep drawInRect:rect];
[super drawInRect:aRect];
}
will display the image. However, there does not appear to be a method
on NSMovie or NSMovieView to let me do something similar? Or am I going
about it in the wrong way to do this for movies?
niall