I'd like to play videos, as well as display images and possibly other flash content using adobe air, and reading from the local file system. I've been searching APIs and I have not yet been able to connect the dots.
I know of flash.filesystem.File and flash.filesystem.FileStream and have experimented with loading and reading files. I believe I can load images this way but haven't tried.
As for video:
mx.controls.VideoDisplay - seems to accept a file:// URI for source, but I can't get it to work.
flash.media.Video - accepts a NetStream or can load video directly from a video input, can't seem to find a way to reference a local file
Can anyone help me out here? I specifically want to load and play video directly off the local disk, not from a web server or a streaming file server... assume no network connectivity.
Slightly related question: Loading a video from the local file system… (but my question does not involve a web browser)
Try adding "-use-network=false" to your Flex compiler settings. This will give you access to load local resources, which could be the source of the problem; the sandboxing rules are somewhat sensitive, so if you're sure you won't need network connectivity, tweaking this setting might relax things a bit.
Also ran across this, which might be related as well:
http://soenkerohde.com/2008/06/playing-local-files-with-air/
In my case, though, just briefly testing, both of the following work in debug and release builds, without modifying the compiler setting, in case it's just the literals you're using to reference the FLVs:
... so I guess it's maybe difficult to diagnose without a bit more information. Hope this helps -- I'll keep an eye on the comments if you want to share a bit more info.
The use I have in mind is required to be programmatic in usage. I was looking for a way to do this directly with ActionScript.
I finally stumbled onto the solution I was hoping for... using a NetStream object, but (non-intuitively) you can use this to access local files as well: