get movie lenght

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
ivaho
Posts: 37
Joined: Tue Feb 14, 2012 2:19 pm

get movie lenght

Post by ivaho »

Hi All,

I'am trying to get the duration in seconds of a movie file when I send it to a server.

The idea is that as soon as I send a movie file to a server a count down timer starts to run telling me how long the movies runs.

kind regards
Ivo
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: get movie lenght

Post by Klaus »

Hi Ivo,

1. load the movie into a (invisible) player object
2. get "the duration of player x"
3. get "the timescale of player x"
4. divide duration/timescale to get the duration in seconds
5. MOST IMPORTANT! Look up these terms in the dictionary 8)

Like this:
...
put the duration of player "your player here..." into tDur
put the timescale of player "your player here..." into tScale
answer tDur/tScale
...

Hint:
This will only work if QuickTime is intalled on the target machine!


Best & groetjes

Klaus
Post Reply