I cannot get the StageWebViewBridge to load external assets

696 Views Asked by At

I am using appfile:/. The path is correct; if I put it on screen and copy-paste it in the explorer it links to the image.

Is there anything else I need to do?

3

There are 3 best solutions below

0
On

Got the same issue and fixed it with "appfile:/"

Why do you require "appfile:/ for a local html file ?

  • If the treated html/js/css is local and asset is relative (aka ../ or no http://) you should treat them as "appfile:/" ?

  • If the treated file is distant you do not have to handle assets ?

Is there a best practice to work with "appfile:/" ?

Actually I debug my html/js/css game in the browser but if I use appfile:/ it will no longer works. I will have to handle 2 behaviors.

1
On

I am also confused on how to access locally packaged assets. I put them in the HTML folder as requested and when I send a signal to the StageWebViewBridge to set the .src attribute of a video I'm not sure how to do it.

Without StageWebViewBridge and entirely in a website I can just reference the file for a video object via JavaScript directly e.g. swvRef.src = 'file.mp4';. This works perfectly fine. When I try to tell flash to send a call via StageWebViewBridge it does receive the call to the StageWebView (I have JavaScript reporting it). However when I try to set the .src of a video object I can't figure out the correct path.

The documentation says to put all things in a 'html' folder. I did so. No reference to a .src of 'html/a.mp4' or 'a.mp4' or 'htmlCache/a.mp4' ever makes the new javascript html5 video class work.

Bridge otherwise is working perfectly sending AS->JS and JS->AS. I'm just looking for info on how to reference packaged files. I want to play a video I put in the /html folder and so far, I just can't do it.

1
On

UPDATED I have updated the library, now is more easy to use. Can you test it?

I am the author of the StageWebViewBridge class. There is a known problem if you are using Android. Anyway, I have a working solution I will update the next week.

If the problem is not in Android, then send me some code.