Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

langer5247

macrumors newbie
Original poster
Jul 11, 2007
1
0
for starters, i am brand new to mac development. I am using Xcode and cocoa. I have a video embedded into the application i am writing and i am using the QTkit famework to accomplish this.
How do I make the video autostart when the application loads?

Its probably right in front of me but i can't seem to figure it out.

Thanks!
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,630
Western US
for starters, i am brand new to mac development. I am using Xcode and cocoa. I have a video embedded into the application i am writing and i am using the QTkit famework to accomplish this.
How do I make the video autostart when the application loads?
There might be some autoplay attribute thingy you can set, but I couldn't find it, so what I would do is just call gotoBeginning: followed immediately by play: on the QTMovie object. Now you will first have to load the movie (unless you have a hard-coded movie path set in the Nib, but that's usually a bad idea), so you could do that by overriding applicationDidFinishLaunching: in your main controller class and calling your movie loading code from there.
 

robbiehanson

macrumors newbie
Apr 25, 2006
5
0
Missouri, US
you could do that by overriding applicationDidFinishLaunching: in your main controller class and calling your movie loading code from there.

The above probably solved your problem. If you invoke the play method at this point, the movie will most likely start playing.

However, there is an exception to this. If you are playing stuff over the internet, or the movie is really really big, QTKit may not have enough of the movie loaded to begin playing it immediately. If this is the case, QTKit will broadcast notifications when enough is loaded to begin playing. See this post for a better explanation: http://deusty.blogspot.com/2007/02/qtmovie-tips.html
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.