【问题标题】:Android 2.2 - WebView, how to open the website with <video> tag inside?Android 2.2 - WebView,如何打开带有 <video> 标签的网站?
【发布时间】:2012-01-14 05:17:24
【问题描述】:

如何打开网页像:

<html><body style="background-color: rgb(38,38,38);"><video controls="" autoplay="" style="margin: auto; position: absolute; top: 0; right: 0; bottom: 0; left: 0;" name="media" src="http://##########################.mp4"></video></body></html>

在网络视图中。甚至不在网络视图内部,但可以有新的意图。 非常感谢您的帮助。 问候

【问题讨论】:

标签: android video webview


【解决方案1】:

找到解决方案,我为加载创建了覆盖以强制打开视频活动并将链接直接传递给文件:

@Override
                public boolean shouldOverrideUrlLoading(WebView view, String url) 
                {
                    if (url.endsWith(".mp4") )
                    {                           
                        data.url = url;
                        Intent intent = new Intent(getApplicationContext(), VideoPlayer.class);
                        startActivity(intent);
                        return true;
                    } 
                    else 
                    {
                        return super.shouldOverrideUrlLoading(view, url);
                    }
                }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多