Skip navigation.
 
mlRe: QTMovieLayer and renderInContext:
FROM : John Clayton
DATE : Thu Nov 22 15:24:20 2007

Hi Bill, thanks for the input... buuuuuut:

Nope, my aim is somewhat different.

I need a movie in a view.  I want the frames of the movie to be in a 
layer.  I do *not* want it to autoplay, and I *do* want to tell the 
layer that the beginTime and duration are X and Y respectively, and I 
do want to be able to control the specific frame that is represented 
on the layer from that movie.

Try thinking about putting a few movies across a timeline, and telling 
them to start/end at a particular time along that timeline.  This is 
what I'm trying to do.

What I've got going so far:
a) a QTMovieLayer (with INF/default duration), rendering a movie (NOT 
autoplay on construction)
b) a slider on a view that tells the NSMovie what render time is, via 
the setCurrentTime:(QTTime) method.

this works.  and I gotta say, beautifully.

where it all breaks down is in the following:
c) set the QTMovieLayers beginTime to something (anything)

now nothing is rendered at all.

So far, my belief/understanding is as follows - but please do feel 
free to enlighten me:

When using (a) and (b), the Core Anim engine sees that the 
QTMovieLayer has an infinite duration, and thus, the movie is a valid 
candidate to be rendered by the Core Anim system.  Every time the 
'rendering time' is modified by the slider, the currentTime of the 
NSMovie is changed - and QTMovieLayer (being async in nature) renders 
the new frame properly.

I'm still not clear why settings a beginTime (as in (c) above)) causes 
the animation to do nothing.

--
john


On 22/11/2007, at 1:27 PM, Bill Dudney wrote:

> Hi John,
>
> I'm not sure that I understand the question but if all you want to 
> do is put a movie layer into a view I have a simple example here 
> that works for me;
>
> - (void)awakeFromNib {
>    NSString *moviePath = @"your path here";
>    NSError *error = nil;
>    movie = [QTMovie movieWithFile:moviePath error:&error];
>    [movie autoplay];
>    QTMovieLayer *layer = [QTMovieLayer layerWithMovie:movie];
>    [self setLayer:layer];
>    [self setWantsLayer:YES];
> }
>
> This awakeFromNib is from my view class that takes up the whole 
> window. The movie plays when the app starts.
>
> In the example (that I've not posted yet but will soon) on my blog I 
> have a 'play' button that sits in the view that the movie plays on 
> and it works like a champ.
>
> HTH,
>
> -bd-
> http://bill.dudney.net/roller/objc
>
> On Nov 21, 2007, at 11:47 PM, John Clayton wrote:
>

>> Hi All,
>>
>> I am trying to use the CALayer renderInContext: call to put the 
>> contents of a QTMovieLayer instance onto a view, but I get a blank 
>> view - nothing renders.
>>
>> Is this call supposed to work for a QTMovieLayer?  I suppose the 
>> question could be expanded to: is the renderInContext: method 
>> supposed to work for any type of open-gl based layer class?
>>
>> Thanks,
>> --
>> John Clayton
>> http://www.coderage-software.com/
>>
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (<email_removed>)
>>
>> 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:
>> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>>
>> This email sent to <email_removed>

>

Related mailsAuthorDate
mlQTMovieLayer and renderInContext: John Clayton Nov 22, 07:47
mlRe: QTMovieLayer and renderInContext: John Clayton Nov 22, 10:07
mlRe: QTMovieLayer and renderInContext: Scott Anguish Nov 22, 11:36
mlRe: QTMovieLayer and renderInContext: Scott Anguish Nov 22, 11:42
mlRe: QTMovieLayer and renderInContext: Bill Dudney Nov 22, 13:27
mlRe: QTMovieLayer and renderInContext: John Clayton Nov 22, 15:24
mlRe: QTMovieLayer and renderInContext: Bill Dudney Nov 23, 14:41
mlRe: QTMovieLayer and renderInContext: John Clayton Nov 23, 16:14
mlRe: QTMovieLayer and renderInContext: Bill Dudney Nov 23, 16:27