Android:用于运行播放 FLV 的 SWF 的 webview。

发布于 2024-12-09 04:38:33 字数 1149 浏览 0 评论 0原文

致力于从 Samsung Galaxy 10.1 pad 上的本地应用程序/文件夹中播放 Flash 项目。 该项目基本上是一个 Flash 文件,它引用播放列表的 xml,其中包含对存储在 asset 子文件夹中的其他 swf 文件或 flv 视频的引用。

使用视频、netConnection 和 netStream 播放 flv,尝试了 FLVPlayback 一会儿,但没有即时修复。

该项目嵌入了 html,并且在本地和服务器上使用它的机器上运行良好。它从网站到应用程序都“有效”,但它会变得笨重,并且在使用这些垫时互联网将不可用。

(但我认为重要的是要注意 flv 播放确实可以从网络到平板电脑上播放,所以我想我的问题的答案可能在于一些我不知道的权限限制。)

我很幸运,有一个应用程序只有一个 webview 加载主 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);

它成功地从播放列表加载 SWF 文件并播放它们,但是一旦它到达 flvs
netStream 弹出一个 NetStream.Play.StreamNotFound:[object NetStream],并通过一些临时操作,netConnection 弹出一个 NetConnection.Connect.Closed:[object NetConnection]代码>

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

所以问题是,我必须更改/添加什么才能使此 SWF 播放 FLV、从互联网上正常播放,但不能从本地应用程序打开 FLV? (另外,我怀疑稍后需要将 FLV 存储在外部以减少应用程序大小,但那是另一个谜语)

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不喜欢何必死缠烂打 2024-12-16 04:38:33

找到了解决方法。尝试将 FLV 嵌入到资产文件夹中进行编译显然不是最好的开始方式。从外部加载文件给了我想要的结果。

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

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");
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文