开发者

CS5.5 import video through jsfl without video wizard

开发者 https://www.devze.com 2023-04-05 16:30 出处:网络
I\'m trying to have a jsfl script import a video into my .fla project and export the entire thing as a .swf automatically Is it possible to disable the video wizard when importing开发者_Go百科 videos?

I'm trying to have a jsfl script import a video into my .fla project and export the entire thing as a .swf automatically Is it possible to disable the video wizard when importing开发者_Go百科 videos? I'd hate to have to manually confirm all the options every single time. The video is in .flv format if that makes any difference


AFAIK you can't bypass the FLV import dialog directly (using the JSFL API).

I've tried automating the FLV import wizard using a Sikuli script. The script can be run from JSFL using the undocumented FLfile.runCommandLine().

I'm using OSX so I'm not sure if this next part applies for Windows too. If I run the sikuli + the script directly:

FLfile.runCommandLine("/Applications/Sikuli-IDE.app/Contents/MacOS/JavaApplicationStub /Users/george/Documents/sikuli/importFLV.skl");

Flash will wait for this to run then continue importing the FLV which is a problem. The Sikuli script will timeout since the Import FLV dialog will never appear.

Still, I can run this:

FLfile.runCommandLine("open -a /Applications/Sikuli-IDE.app/Contents/MacOS/JavaApplicationStub /Users/george/Documents/sikuli/importFLV.skl");

And this seems to open a window of the application and runs the script asynchronously, which is great. Then I run the import. The sikuli script:

  1. waits for the faded out(out of focus) dialog
  2. clicks to get focus
  3. clicks the Embed FLV in SWF and play in timeline option
  4. waits for the dialog with the proper option selected
  5. clicks Continue
  6. waits for the next screen
  7. clicks Continue
  8. waits for the next screen
  9. clicks Finish

Also, on my machine, the script always worked when I had SikuliIDE open (with no particular script) and minimized.

The full test script to import a video looks like this:

var doc = fl.getDocumentDOM();
FLfile.runCommandLine("open -a /Applications/Sikuli-IDE.app/Contents/MacOS/JavaApplicationStub /Users/george/Documents/sikuli/importFLV.skl");
var path = FLfile.platformPathToURI('Users/george/Desktop/cuePointTest_1.flv');
doc.importFile(path);

You can find a recording of the script running here. After I run the JSFL script, the rest of the clicks are handled by Sikuli. You can also download the source script and the Sikuli executable script for my setup, but I imagine it will be different on yours. Sikuli is easy to use: type a command, go to your app and press CMD/Ctrl + Shift + 2 to grab a snapshot and continue.

If this does the job for your, then you can probably modify the sikuli script to wait for some time to do the clicks for the next video in the sequence, while Flash loads a new document. There should be other workarounds to manage a list of videos, but that makes sense if this solution works for your setup.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号