views:

535

answers:

2

I'm trying to add some video playback (that will be used for a tutorial) to my Adobe Air application. I'm not a Flex or Flash developer and my application is HTML/Javascript based, so I'm having trouble with some of the video solutions I've been able to find.

Here is one of the examples I've found that is flex based: Playing local files with Air

I've looked for a free flash video player that I could just embed. But the only one I've found I was unable to coerce to play files from my Air application directory.

I was exited at the prospect of using the HTML5 video tag which I thought Air supported, but that also seems to not work.

Can anyone recommend a free flash video player that I can embed? Or a solution that doesn't have to be built completely from flex?

A: 

One way is to use an absolute url for the video files.

Depending on the player, that might not be possible, so another way is put the player inside an iframe and use the special AIR iframe attributes documentRoot and sandboxRoot to map the player and the videos into a virtual remote domain.

See http://help.adobe.com/en%5FUS/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7f08.html for a description on how to do this. I believe you also have to put the videos and maybe the player into a subdirectory of the AIR application folder (but I'm still investigating that aspect).

The root of the problem is that when a SWF file running in the HTML environment in AIR asks AIR to resolve a file in the application directory, AIR reports something like "app:/foo.flv". However, the Flash Player plug-in doesn't know anything about the app:/ URL scheme, so it can't load the files. The workarounds above avoid the file resolution issue.

Another possible workaround is to play the videos from a directory outside the application directory.

A: 

wow that was a weak answer--look at this page...it has the beginning, but infuriatingly, Adobe's online documentation has not yet covered the air.Video object (at all!) no amount of Google searching will help. There are a few other posts out there, but they have the same info. Good luck!

http://anirudhs.chaosnet.org/blog/2007.12.19.html

Rob