1

i load an url given by other system in webview.but it doesn't display all contents,it leaves a blank window in the page.i check the source code,it has a frameset tag and some iframe tags. att src is correct.why it can't load content from src?does webchromeclient support php iframe tag?

<frameset id ="dispframeset" rows="*,6%" frameborder="NO" border="0" framespacing="0">
    <frame id="articleFrame" src="/csp/kbs/showKngContent.action?inRecycle=&kngTblFlag=0&kngId=20130228152142812001&dispId=&articleFlag=true&relativeKngFlag=true&buttonFlag=true&coluKngType=2&kngPath=&coluKngName=&kngPointId=&kngPointName=&kngPointPath=&showType=1&backBtnFlag=&dispTmpPreview=&channelId=0&curChannelId=&currentChannelId=&isBackOrGoahead=&clickingLogFlag=" name="articleFrame" scrolling="no" resize/>
    <frame id="articleButtonFrame" src="/csp/kbs/showKngButton.action?kngId=20130228152142812001&dispId=&kngTblFlag=0&buttonFlag=true&showType=1&channelId=0" name="articleButtonFrame" scrolling="auto" resize/>
</frameset>

by the way,the web app works well in IE browser,but sucks in chrome.

thk in advance.

kevin
  • 11
  • 3

1 Answers1

0

As of my concern WebChromeClient supports iframe tag. In my case I have given the iframe tag to webview in the following way.

<iframe width=\"480\" height=\"270\" src=\"http://staging.snagfilms.com/modules/html5player.jsp?filmId=ed9195a0-a748-11e0-a92a-0026bb61d036&w=500\" frameborder=\"0\" allowfullscreen></iframe>

above is the iframe tag , I am getting from server

myWebView = (CustomFacedWebView) findViewById(R.id.web_wrap_browser);
myWebView.getSettings().setPluginsEnabled(true);
        myWebView.getSettings().setJavaScriptEnabled(true);
        myWebView.getSettings().setPluginState(PluginState.ON);
        chromeClient = new MyChromeClient();
        myWebView.setWebChromeClient(chromeClient);
myWebView.loadUrl(URL)
webRoot = (ViewGroup) findViewById(R.id.web_root_view);
        systemRoot = (ViewGroup) webRoot.getParent();



private final class MyChromeClient extends WebChromeClient implements OnCompletionListener, OnErrorListener {
        CustomViewCallback fullscreenCallback;
        VideoView htmlVideoView;

        @Override
        public void onShowCustomView(final View view, final CustomViewCallback callback) {
            super.onShowCustomView(view, callback);

            fullscreenCallback = callback;
            systemRoot.removeAllViews();
            setContentView(view);
            fullScreen = true;
            ............    

        }


        @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
        @Override
        public void onShowCustomView(final View view, final int requestedOrientation,
                final CustomViewCallback callback) {
            super.onShowCustomView(view, requestedOrientation, callback);

            systemRoot.removeAllViews();
            setContentView(view);
            setRequestedOrientation(requestedOrientation);
            fullscreenCallback = callback;

        }

        @Override
        public void onHideCustomView() {
            super.onHideCustomView();
            if(htmlVideoView != null) {
                htmlVideoView.stopPlayback();
            }
            if(webRoot != null) {
                systemRoot.removeAllViews();
                setContentView(webRoot);
            }
            try{
            if(fullscreenCallback != null)
                fullscreenCallback.onCustomViewHidden();
            } catch(Exception e) {
                e.printStackTrace();
            }
            fullScreen = false;

        }

        @Override
        public boolean onError(MediaPlayer mp, int what, int extra) {
            onHideCustomView();
            return false;
        }

        @Override
        public void onCompletion(MediaPlayer mp) {
            onHideCustomView();
        }
    }
  • here is my situation. when i first load the page with the complete url,it works well. so i click a link in the page,the new page left a blank .i found all the pages contain iframe tags. the only difference between first page and the second page which i clicked is url link. first time i load the page with an complete url,but the second page opened with a relative url,does it relevant to the question? – kevin Mar 11 '13 at 13:07