• 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: QTMovieLayer and renderInContext:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QTMovieLayer and renderInContext:


  • Subject: Re: QTMovieLayer and renderInContext:
  • From: John Clayton <email@hidden>
  • Date: Thu, 22 Nov 2007 15:24:20 +0100

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@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


_______________________________________________

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


  • Follow-Ups:
    • Re: QTMovieLayer and renderInContext:
      • From: Bill Dudney <email@hidden>
References: 
 >QTMovieLayer and renderInContext: (From: John Clayton <email@hidden>)
 >Re: QTMovieLayer and renderInContext: (From: Bill Dudney <email@hidden>)

  • Prev by Date: Re: QTMovieLayer and renderInContext:
  • Next by Date: Re: CoverFlow
  • Previous by thread: Re: QTMovieLayer and renderInContext:
  • Next by thread: Re: QTMovieLayer and renderInContext:
  • Index(es):
    • Date
    • Thread