Android: webview to run SWF that plays FLVs.

1.2k Views Asked by At

Working on getting a flash project to play from a local app/folder on a Samsung Galaxy 10.1 pad. the project is basically a flash-file that references a xml for a playlist, which contains references to other swf files or flv videos which are stored in an asset subfolder.

Using video, netConnection and netStream to play the flv's, tried FLVPlayback for a moment but no insta-fix.

The project was embedded with html and works fine for the machines it is being used on, both local and from a server. It "works" from website to the app, but it gets chunky and internet will not be available when these pads are in use.

(But I think it's important to note that flv playback DOES work from the web onto the pad, so I guess the answer to my problems might be in some permission-limitation that I don't know of. )

I've had luck with an app just having a webview load the main swf:

WebView wv = new WebView(this);
WebSettings webSettings = wv.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setPluginsEnabled(true);
wv.loadUrl("file:///android_asset/DemoV6/main.swf");
setContentView(wv);

It successfully loads SWF files from the playlist and plays them, but once it gets to the flvs the
netStream pops out an NetStream.Play.StreamNotFound:[object NetStream], and with a bit of jury-rigging the netConnection pops out a NetConnection.Connect.Closed:[object NetConnection]

[ tl/dr: (Android3.1/galaxy 10.1) --> swf --> flv ==problem ]

So the question is, what do I have to change/add to make this SWF that plays FLVs, that plays fine from the internet, but does not open FLVs from an local app? (Also, I suspect I need to store the FLV's externally later on to reduce app-size, but thats a different riddle)

1

There are 1 best solutions below

0
On BEST ANSWER

Found a way around it. Attempting to embed the FLVs into the assets folder for compilation was apparently not the best way to start with. loading the files externally gave me the result I wanted.

if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){
    Log.d(TAG, "No SDCARD");
} else {
    webView.loadUrl("file://"+Environment.getExternalStorageDirectory()+"/Folder/main.swf");
}