如何发挥媒体文件(3GP / SWF文件)在本地内的WebView [英] How to play media files (3GP/swf files) locally inside webview

查看:270
本文介绍了如何发挥媒体文件(3GP / SWF文件)在本地内的WebView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

荫找打内线的WebView媒体文件,能否请你帮我出..what加载网页流量为IAM missing..I: _webview.loadUrl(文件:///android_asset/3gp.html ); 和我的HTML文件中的code是:

Iam looking for playing media files inside webview Can you please help me out ..what iam missing..I loaded webview as : _webview.loadUrl("file:///android_asset/3gp.html"); and the code inside my html file is as:

<body>
<object width="550" height="400">
<param name="movie" value="sample.3gp">
<embed src="file:///android_asset/sample.3gp" width="550" height="400">
</embed>
</object>
</body>.

荫没有得到的输出。请HELLP我出去..Thanks提前

Iam not getting the output. Please hellp me out ..Thanks in advance

推荐答案

要播放SWF文件,你必须启用插件:

To play SWF files you have to enable plugins:

_webview.getSettings().setPluginState(PluginState.ON);

如果你的HTML文件使用JavaScript:

and if your .html file uses javascript:

_webview.getSettings().setJavaScriptEnabled(true);

编辑回答评论

在你的情况,你需要在一刻链接使用自己的WebView重定向到浏览器:

In your situation you need to use your own webview at the moment links are redirecting to the browser:

 _webview.setWebViewClient(new DownloadWebViewClient());

 public class DownloadWebViewClient extends WebViewClient{

    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
                return false; // Allows your webview to handle clicked links                
    }
 }

这篇关于如何发挥媒体文件(3GP / SWF文件)在本地内的WebView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆