how do you determine if a file is a media file?
Klaus Major
klaus at major-k.de
Thu Sep 27 03:38:56 EDT 2007
Hi Josh,
> I am working on a handler to determine whether a file is a media
> file. (for OS X and Windows)
>
> First, I check if the file has a proper extension (.mov, .jpg,
> etc.) if so, I assume the extension is correct (a leap of faith
> perhaps)
>
> Second, I try to get the OS X filetype from the detailed files.
> Some movies properly list "Moov", some don't.
>
> Third, was going to try loading the file into a Player or Image
> object and see if there's an error, but many types of files will
> load into those objects fine (like text files)
>
> So, I'm wondering if anyone has any tips beyond these things...
again this might be a case for Trevor's EXCELLENT QT External :-)
From the docs:
function qtGetMovieFileType (FilePath)
Description:
Returns the type of a file on disk.
Parameters:
FilePath: Path to movie file.
Return:
Type (multiframe graphic, image, qtvr, flash, video, sound, unknown,
unsupported)
Maybe that can help you to decide to load a file into a player or not.
Regards
Klaus Major
klaus at major-k.de
http://www.major-k.de
P.S.
Perhaps you should print out the docs and put them under your pillow ;-)
More information about the use-livecode
mailing list