astralmaster
astralmaster

Reputation: 2465

execute media files from AIR 3

I know that since AIR 2.0 it is possible to execute applications (.exe) like this:

if(NativeProcess.isSupported)
{
    var file:File = File.desktopDirectory;
    file = file.resolvePath("StyleLookupold.exe");

    var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
    nativeProcessStartupInfo.executable = file;
    var process:NativeProcess = new NativeProcess();

    process.start(nativeProcessStartupInfo);

}

But is it possible to open a video in system's default player? For example executing Windows Media Player with command line parameter being the path to the video to play?

Upvotes: 0

Views: 155

Answers (1)

shaunhusain
shaunhusain

Reputation: 19748

http://cookbooks.adobe.com/post_Open_file_with_Default_Application_AIR_2_0-16745.html Use openWithDefaultApplication method on the File object available in AIR 2 and greater.

Upvotes: 1

Related Questions