Android, StageWebView and Local media files in mobile app
Hi,
I am building a cross-platform mobile app with Flash Builder 4.6 (for iOS and Android). The app needs to have several hundred Mbs of video packaged with the app so that they run quickly and beautifully, with the native player controls. I ued an instance of StageWebView and loaded a local URL using nativePath and URL, which worked a treat on iOS. When testing on a Motorola Xoom, I get nothing. I can use the SWV instance to load up a remote file (ie Google.com) and it works fine on the Android device, but no local files. I understand that Android doesn't like the app URI, so I have changed from nativePath to the URL string, and still nothing. I have tried loading a local HTML file which embeds the necessary video in it, and no dice; the html page loads fine, but can't load the video.
Here's some code:
webView = new StageWebView;
webView.stage = this.stage;
webView.viewPort = new Rectangle(200,200,480,360);
var fPath:File = File.applicationDirectory.resolvePath("/assets/absMovie.html");
trace("fpath = "+fPath.nativePath);
var fPath2:String = fPath.url;
webView.loadURL(fPath2);
trace("fPath2 = "+fPath2);
Here is my console after running:
fpath = /assets/absMovie.html
fPath2 = file:///assets/absMovie.html
Error #2044: Unhandled ErrorEvent:. text=[-1] The Web page contains an error.: file:///assets/absMovie.html
I have been banging my head against this particular wall for over a week now, and I need to figure this out.
Any help would be appreciated.
Kindest Regards,
William