1

问题描述

我正在尝试通过调用 loadDataWithBaseURL 方法并将嵌入数据传递给它来播放 SWF 视频。但是视频没有开始播放,只是显示白屏。难道我做错了什么 ?

源代码

protected void onCreate(Bundle savedInstanceState) {
    // Get Web View from the layout.
    mWebView = (WebView) findViewById(R.id.webViewOnlieWebCams);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.getSettings().setPluginsEnabled(true);
    mWebView.getSettings().setAllowFileAccess(true);
                    
    String mimeType = "text/html";  
    String encoding = "utf-8";  
    String embed = "<embed type=\"application/x-shockwave-flash\" src=\"/bundles/mymain/swf/player-licensed.swf\" width=\"320\" height=\"390\" style=\"undefined\" id=\"mpl\" name=\"mpl\" quality=\"low\" allowfullscreen=\"true\" allowscriptaccess=\"always\" wmode=\"opaque\" flashvars=\"autostart=true&amp;file=camera39.stream&amp;streamer=rtmp://wss.yerevan.am/axis&amp;logo=/bundles/mymain/images/logo10.png&amp;logo.hide=false&amp;logo.position=bottom-left&amp;logo.timeout=3\">";

    mWebView.loadDataWithBaseURL(null, embed, mimeType, encoding, "");      
}


    
    
4

1 回答 1

2

尝试使用以下代码:

String html = "<object width=\"1008\"height=\"550\"> <param name=\"movie\" value=\"file://"
                        + path
                        + "\"> <embed src=\"file://"
                        + path
                        + "\" width=\"1008\"height=550\"> </embed> </object>";
                String mimeType = "text/html";
                String encoding = "utf-8";
                web.loadDataWithBaseURL("null", html, mimeType, encoding, "");
于 2013-11-16T06:04:40.153 回答