QuickTime download question

Peter Bogdanoff bogdanoff at me.com
Wed May 23 19:22:26 EDT 2012


Thanks, Klaus, I'll look into this.

On May 23, 2012, at 9:07 AM, Klaus on-rev wrote:

> Hi Peter,
> 
> Am 23.05.2012 um 04:18 schrieb Peter Bogdanoff:
> 
>> Hi,
>> This is one for QT experts!
>> 
>> I'm using a player to play audio files from a server on the Internet. They are large (symphony movements--30 MB or more) and can take several minutes to download. I'm using QT's fast start to start them playing as soon as possible. They are also interactive in that I allow the user to set the startTime by clicking on a button in a sequence of timed buttons.
>> 
>> The issue is with these larger files. If the user tries to set a startTime beyond what has downloaded so far, the player starts back at zero rather than, say 10000, which the user clicked on. QT fast start isn't true streaming, so you can't jump into the middle of a movie and start playing from there without all of the previous data present.
>> 
>> I have to allow this behavior, but I want to tell the user to wait for the download, and then start automatically playing when the player has downloaded enough data. If the user starts from the beginning it works immediately and the user experience is unchallenged. But if he jumps to the middle, I'm expecting that he will be content to wait for the download to get to that point. (He never sees the QT controller.)
>> 
>> So, I need to know how much data has downloaded so far, so I can either play the thing or wait until enough is in memory, and then start playing. I don't see a property for this. Duration gives me the entire length of the file, including what has now yet downloaded. Size only works for audioClips, which I'm not using.
>> 
>> Is there a way to determine how much data has downloaded of a QT file? 
>> 
>> Incidentally, I tried messing with the load command. What seemed to happen is the player played the fast start movie simultaneously with another process loading the file. The loaded file is unavailable until it completely downloads, so that's no help.
>> 
>> Any help is much appreciated!
> 
> use Trevors wonderful Enhanced QuickTime external:
> <http://www.bluemangolearning.com/revolution/software/externals/eqt/>
> 
> Looks like this will do what you need!
> From the docs:
> ...
> function qtGetMaxLoadedTimeInMovie (MovieControllerID)
> Description:
> Returns the download state of the movie controller.
> Parameters:
> MovieControllerID: movieControllerID.
> Return:
> Total movie downloaded in movie's time base.
> ...
> function qtGetMovieLoadState (MovieControllerID)
> Description:
> Returns the download state of the movie controller. 
> This function lets your code perform relative comparisons against movie loading milestones to determine if certain operations make sense. Don't call more often then every quarter of a second. Its return values are ordered so that they conform to this rule: 
> kMovieLoadStateError 
> < kMovieLoadStateLoading 
> < kMovieLoadStatePlayable 
> < kMovieLoadStateComplete 
> Parameters:
> MovieControllerID: movieControllerID.
> Return:
> Integer value: 
> -1 (kMovieLoadStateError)
> 1000 (kMovieLoadStateLoading)
> 10000 (kMovieLoadStatePlayable)
> 20000 (kMovieLoadStatePlayThroughOK)
> 100000 (kMovieLoadStateComplete)
> ...
> 
> and much more cool QT stuff!
> 
>> Peter
>> UCLA
> 
> Best
> 
> Klaus
> 
> --
> Klaus Major
> http://www.major-k.de
> klaus at major.on-rev.com
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list